Today i needed to assign security role to team and user using rest api through postman:
Below is the sample request:-
- Assign role to team
Method : Post
Url: https://yourceinstancename.api.crm9.dynamics.com/api/data/v9.1/teams(teamguid)/teamroles_association/$ref
Body:
{
"@odata.id":"https://yourceinstancename.api.crm9.dynamics.com/api/data/v9.1/roles(roleguid)"
}
2. Assign role to user
Method : Post
Url: https://yourceinstancename.api.crm9.dynamics.com/api/data/v9.1/systemusers(systemuserguid)/systemuserroles_association/$ref
Body:
{
"@odata.id":"https://yourceinstancename.api.crm9.dynamics.com/api/data/v9.1/roles(roleguid)"
}
Just replace yourceinstancename, teamguid , systemuserguid , roleguid as per your values. Also change crm9 to value as per your region.
Hope it would be helpful..:)