Discussions
API Company Admin role delete issue
Apologies in advance for the length. We are attempting to use the iMIS API for deleting a company administrator relationship. By setting the MembershipDetails.IsMarkedForDelete property to true, as referenced in this discussion item - https://developer.imis.com/discuss/601ae38a47cdf0007abca38d - we were able to get a successful deletion of the company administrator relationship; however, we subsequently discovered that other relationships for the particular group member were also being deleted.
A similar JSON POST, essentially the same script without the IsMarkedForDelete property set to true, is working perfectly for us for adding a company administrator relationship through the API without any unintended consequences.
Below is the JSON string we are using to POST to /api/GroupMember/
{
"$type": "Asi.Soa.Membership.DataContracts.GroupMemberData, Asi.Contracts",
"MembershipDetails": {
"$type": "Asi.Soa.Membership.DataContracts.GroupMemberDetailDataCollection, Asi.Contracts",
"$values": [
{
"$type": "Asi.Soa.Membership.DataContracts.GroupMemberDetailData, Asi.Contracts",
"GroupMemberDetailId": "ORGRELATIONSHIP-25049:28139",
"Stage": {
"$type": "Asi.Soa.Membership.DataContracts.GroupStageData, Asi.Contracts"
},
"IsActive": true,
"Role": {
"$type": "Asi.Soa.Membership.DataContracts.GroupRoleData, Asi.Contracts",
"RoleId": "COMPANYADMINISTRATOR",
"Name": "Company Administrator"
},
"IsMarkedForDelete": true
}
]
},
"Group": {
"$type": "Asi.Soa.Membership.DataContracts.GroupSummaryData, Asi.Contracts",
"GroupId": "ORGRELATIONSHIP-25049",
"Name": "Aiken",
"Description": "Organizational Relationship",
"ParentIdentity": {
"$type": "Asi.Soa.Core.DataContracts.IdentityData, Asi.Contracts",
"EntityTypeName": "Party",
"IdentityElements": {
"$type": "System.Collections.ObjectModel.Collection`1[[System.String, mscorlib]], mscorlib",
"$values": [
"25049"
]
}
},
"GroupClass": {
"$type": "Asi.Soa.Membership.DataContracts.GroupClassSummaryData, Asi.Contracts",
"GroupClassId": "ORGRELATIONSHIP",
"Name": "Organization",
"Description": ""
},
"StatusCode": "A"
},
"Party": {
"$type": "Asi.Soa.Membership.DataContracts.PartySummaryData, Asi.Contracts",
"PartyId": "28139",
"Id": "28139",
"Status": {
"$type": "Asi.Soa.Membership.DataContracts.PartyStatusData, Asi.Contracts",
"PartyStatusId": "A",
"Name": "Active",
"Description": "Active"
}
}
}
Below is the object response received after the above JSON POST to /api/GroupMember/ was executed and indicating the MembershipDetails.IsMarkedForDelete property was set to true by our script. No other relationships appear to be referenced.
{$type: 'Asi.Soa.Membership.DataContracts.GroupMemberData, Asi.Contracts', MembershipDetails: {…}, Group: {…}, Party: {…}}
$type: "Asi.Soa.Membership.DataContracts.GroupMemberData, Asi.Contracts"
Group:
$type: "Asi.Soa.Membership.DataContracts.GroupSummaryData, Asi.Contracts"
Description: "Organizational Relationship"
GroupClass:
$type: "Asi.Soa.Membership.DataContracts.GroupClassSummaryData, Asi.Contracts"
Description: ""
GroupClassId: "ORGRELATIONSHIP"
Name: "Organization"
[[Prototype]]: Object
GroupId: "ORGRELATIONSHIP-25049"
Name: "Aiken"
ParentIdentity: {$type: 'Asi.Soa.Core.DataContracts.IdentityData, Asi.Contracts', EntityTypeName: 'Party', IdentityElements: {…}}
[[Prototype]]: Object
MembershipDetails:
$type: "Asi.Soa.Membership.DataContracts.GroupMemberDetailDataCollection, Asi.Contracts"
$values: Array(1)
0:
$type: "Asi.Soa.Membership.DataContracts.GroupMemberDetailData, Asi.Contracts"
GroupMemberDetailId: "ORGRELATIONSHIP-25049:28139"
IsActive: true
IsMarkedForDelete: true
Role:
$type: "Asi.Soa.Membership.DataContracts.GroupRoleData, Asi.Contracts"
Description: "Company Administrator"
Name: "_ORG-ADMIN"
Priority: 1
RoleId: "COMPANYADMINISTRATOR"
UseTitle: true
[[Prototype]]: Object
Stage: {$type: 'Asi.Soa.Membership.DataContracts.GroupStageData, Asi.Contracts'}
[[Prototype]]: Object
length: 1
[[Prototype]]: Array(0)
[[Prototype]]: Object
Party:
$type: "Asi.Soa.Membership.DataContracts.PartySummaryData, Asi.Contracts"
CityName: "Aiken"
CountryName: "United States"
CountrySubEntityName: "SC"
Email: "[email protected]"
Id: "28139"
IsMarkedForDelete: false
Name: "Ms. April D Golding"
PartyId: "28139"
Phone: ""
Sort: "GOLDING, APRIL D"
Status: {$type: 'Asi.Soa.Membership.DataContracts.PartyStatusData, Asi.Contracts', PartyStatusId: 'A', Name: 'Active', Description: 'Active'}
UniformId: "b5fc336c-0d34-4f50-b5cd-8990f285a12e"
[[Prototype]]: Object
[[Prototype]]: Object
Below is a subsequent api/GroupMember/ GET object response for the same person indicating that the Company Adminstrator relationship has been removed but a number of other relationships are also no longer reflected. The two remaining relationships - "Aiken" (chapter membership) and "Regular Member" appear to be consistant across other member IDs that we have run the group delete script against. These same relationships have been confirmed via our iMIS system.
{$type: 'Asi.Soa.Core.DataContracts.PagedResult1[[Asi.Soa.…s.GroupMemberData, Asi.Contracts]], Asi.Contracts', Items: {…}, Offset: 0, Limit: 100, Count: 2, …} $type: "Asi.Soa.Core.DataContracts.PagedResult
1[[Asi.Soa.Membership.DataContracts.GroupMemberData, Asi.Contracts]], Asi.Contracts"
Count: 2
HasNext: false
Items:
$type: "System.Collections.Generic.List`1[[Asi.Soa.Membership.DataContracts.GroupMemberData, Asi.Contracts]], mscorlib"
$values: Array(2)
0:
$type: "Asi.Soa.Membership.DataContracts.GroupMemberData, Asi.Contracts"
DropDate: "2099-12-31T00:00:00"
Group: {$type: 'Asi.Soa.Membership.DataContracts.GroupSummaryData, Asi.Contracts', GroupId: 'CHAPT/25049', Name: 'Aiken', Description: '', ParentIdentity: {…}, …}
GroupMemberId: "CHAPT/25049:28139"
IsActive: true
JoinDate: "2010-10-27T00:00:00"
MembershipDetails: {$type: 'Asi.Soa.Membership.DataContracts.GroupMemberDetailDataCollection, Asi.Contracts', $values: Array(1)}
Party: {$type: 'Asi.Soa.Membership.DataContracts.PartySummaryData, Asi.Contracts', CityName: 'Aiken', CountryName: 'United States', CountrySubEntityName: 'SC', Email: '[email protected]', …}
[[Prototype]]: Object
1:
$type: "Asi.Soa.Membership.DataContracts.GroupMemberData, Asi.Contracts"
DropDate: "2019-11-30T00:00:00"
Group: {$type: 'Asi.Soa.Membership.DataContracts.GroupSummaryData, Asi.Contracts', GroupId: 'MT-M', Name: 'Regular Member', Description: 'Regular Member', ParentIdentity: {…}, …}
GroupMemberId: "MT-M:28139"
IsActive: true
JoinDate: "2010-10-27T00:00:00"
MembershipDetails: {$type: 'Asi.Soa.Membership.DataContracts.GroupMemberDetailDataCollection, Asi.Contracts', $values: Array(0)}
Party: {$type: 'Asi.Soa.Membership.DataContracts.PartySummaryData, Asi.Contracts', CityName: 'Aiken', CountryName: 'United States', CountrySubEntityName: 'SC', Email: '[email protected]', …}
[[Prototype]]: Object
length: 2
[[Prototype]]: Array(0)
[[Prototype]]: Object
Limit: 100
NextOffset: 0
NextPageLink: null
Offset: 0
TotalCount: 2
[[Prototype]]: Object
We are hesitant to do any further testing or investigation of this due to data concerns. Are you able to determine if we have anything incorrect in our current approach or if there is an alternate approach to deleting Company Administrator relationships? Thank you in advance and please let us know if you have any questions or need any additional details.
Matt