Assign project and role to user

Available in versions: 2020 SP3 and later

Description

Assigns a specific project and role to a user.

URL

Copy code
/Admin/rest/v1/users/assignUser/{userID}

Remarks

This API should be authorized for the Project Admin, Application Admin, Tenant Admin, and Site Admin permission levels.

HTTP method

POST: Assigns a project and role to a specified user.

Request

Headers:

One of the following:

  • Content-Type: application/xml

  • Content-Type: application/json

Cookies:

ADM_LWSSO={AdmLwssoCookie};

Request body:

An XML or JSON describing details of the user to be assigned.

The request contains the following fields.

ElementDescription
UserIDThe ID of the user assigned to the project and role.
ProjectIdThe project ID assigned to the user.
RoleThe name of the role assigned to the user

Request examples:

Copy code
XML example:
<LRE_Server>/Admin/rest/v1/users/assignUser/2
Content-Type: application/xml
Accept: application/xml
Cookie: ADM_LWSSO={AdmLwssoCookie};

<ProjectRole> 
  <ProjectId>4</ProjectId>
  <Role>Viewer</Role>
</ProjectRole> 
Copy code
JSON example:
<LRE_Server>/Admin/rest/v1/users/assignUser/2
Content-Type: application/json
Accept: application/json
Cookie: ADM_LWSSO={AdmLwssoCookie};

{
        "ProjectId": "4",
        "Role": "Viewer"
}

Response

Headers:

None

Cookies:

None

HTML Return Code:

One of the HTTP return codes.

Upon successful assignment, returns HTTP status 200 (OK).

See also: