Arun Vinoth @ Dynamics

Arun Vinoth @ Dynamics

https://arundynamix.blogspot.com

Adding multiple CRM users to Team in single web api call

Published

Often times we won’t find the complete code sample, working example snippet, JSON payload to test from MS documentation. One such example is this scenario, when a community peer was looking for complete web api snippet and payload to make a SDK call successful in this Stack Overflow question.

There is an existing action - AddMembersTeam and just the JSON array of users to be sent in payload is not explained clearly in MS docs.

I was able to try in CRM REST builder and compose in editor mode, with the help of another community post. The complete payload will look like this:

POST [Organization URI]/api/data/v9.0/teams(team-guid-id)/Microsoft.Dynamics.CRM.AddMembersTeam HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
OData-MaxVersion: 4.0
OData-Version: 4.0

{
"Members": [{
"@odata.type": "Microsoft.Dynamics.CRM.systemuser",
"ownerid": "85927c2e-52e6-e511-80e7-0050569e0d14"
},{
"@odata.type": "Microsoft.Dynamics.CRM.systemuser",
"ownerid": "ebb0ec50-733f-e811-a964-000d3a34edeb"
}]
}

Continue to website...

More from Arun Vinoth @ Dynamics