Assign Security Role to team and user through rest api in MS CRM

Today i needed to assign security role to team and user using rest api through postman:

Below is the sample request:-

  1. 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..:)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: