Discussions

Ask a Question
Back to All

How to get and post data to https://reinz.imiscloud.com/api/CsRelationship/ endpoint?

Hi,

I need some help on this.

I am trying to post data to https://reinz.imiscloud.com/api/CsRelationship/ endpoint and before posting I can't get the data through an id using above endpoint.

I am getting 400 bad request when I try to get data through id.

This is the URL I used to get data- https://reinz.imiscloud.com/api/CsRelationship/411609

Error message:

{"$type":"Asi.Soa.Core.DataContracts.ValidationResultsData, Asi.Contracts","Errors":{"$type":"Asi.Soa.Core.DataContracts.ValidationResultDataCollection, Asi.Contracts","$values":[{"$type":"Asi.Soa.Core.DataContracts.ValidationResultData, Asi.Contracts","Message":"The identity did not match expected number of elements."}]},"Warnings":{"$type":"Asi.Soa.Core.DataContracts.ValidationResultDataCollection, Asi.Contracts","$values":[]}}

Also, if I try to post data, I am getting "Do not have permission". I followed the example shared on this post https://developer.imis.com/discuss/5f45283c22311e044a92fcb8 but doesn't worked for me.

Here is the json, I am trying to post

{
"$type": "Asi.Soa.Core.DataContracts.GenericEntityData, Asi.Contracts",
"EntityTypeName": "CsRelationship",
"PrimaryParentEntityTypeName": "Party",
"PrimaryParentIdentity": {
"$type": "Asi.Soa.Core.DataContracts.IdentityData, Asi.Contracts",
"EntityTypeName": "Party",
"IdentityElements": {
"$type": "System.Collections.ObjectModel.Collection`1[[System.String, mscorlib]], mscorlib",
"$values": [
"411609"
]
}
},
"Properties": {
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyDataCollection, Asi.Contracts",
"$values": [
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "BeginDate",
"Value": "0001-01-01T00:00:00"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "EndDate",
"Value": "0001-01-01T00:00:00"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "FunctionalTitle",
"Value": ""
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "GroupCode",
"Value": ""
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "ID",
"Value": "411609"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "Note",
"Value": ""
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "RelatedToID",
"Value": "411613"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "RelatedToName",
"Value": ""
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "Relationship",
"Value": "INCHARGE"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "Status",
"Value": ""
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "Title",
"Value": ""
}
]
}
}
I hope to hear soon with some reply that works for this endpoint.

Many thanks

Admin

Hi Gagandeep,

Apologies for the late reply - our development team was in training when your post came in and we are catching up with older posts.

Did you find an answer? If not, can I ask what type of user you are logged in as while trying to make this update? CsRelationship is a business object-based enpdoint which means it follows the same update permission checking as the parent party. The user you are logged in as would need edit permission to Party 411609 in order to complete this update.

There is another alternative for updating relationships if you want to try that instead. All relationships are also available via the GroupMember endpoint. To find this same relationship on that endpoint, you should be able to do a GET request similar to this:

https://{{URL}}/api/GroupMember?Group.GroupClassId=RELATIONSHIP&Party.PartyId=411609

Let me know if this helps.

Thanks,
Courtney

Hi Courtney,

Thanks alot for replying me back.
I got the answer to this post and also used GroupMember endpoint to update :)

That helped me.

Thanks

Admin

That's good to hear! Thanks for the update.

Courtney

ο»Ώ

Contact us
Copyright Β© Advanced Solutions International, All rights reserved.