Skip to content

CheckUserInTeam

Allan De Castro edited this page Jan 6, 2021 · 4 revisions

This custom API allows you to check if a specific user (or the InitiatingUser if the parameter is not set) belongs to the team defined in parameter (using the name or the reference to that security role).

Custom API Definition

Unique Name Name/Display Name Binding Type Bound Entity Logical Name Is Function Is Private Allowed Custom Processing Step Type Execute privilege Name
dtv_CheckUserInTeam dtv_CheckUserInTeam Global N/A ✔️ None None

Custom API Request Parameter(s)

Name Type Is Optional
TeamName String ✔️
TeamGuid Guid ✔️
UserGuid Guid ✔️

Custom API Response Property(ies)

Name Type
IsUserInTeam Boolean

Calling Custom APIs from SDK

OrganizationRequest request = new OrganizationRequest("dtv_CheckUserInTeam")
{
  ["TeamName"] = "NameOfTheTeam",
  ["UserGuid"] = new Guid("8ff9ca3f-f506-eb11-a812-0022480497bc"),
  ["TeamGuid"] = new Guid("8e0abfbf-be06-eb11-a812-0022480497bc"),
};
OrganizationResponse response = svc.Execute(request);

Calling Custom APIs from WebAPI

Request:

https://org.crm.dynamics.com/api/data/v9.1/dtv_CheckUserInTeam(TeamName='NameOfTheTeam',UserGuid=8ff9ca3f-f506-eb11-a812-0022480497bc,TeamGuid=8e0abfbf-be06-eb11-a812-0022480497bc)

Request Body: N/A

Response:

{
    "@odata.context": "https://org.crm.dynamics.com/api/data/v9.1/$metadata#Microsoft.Dynamics.CRM.dtv_CheckUserInTeamResponse",
    "IsUserInTeam": true
}