Assign User Roles¶
Assign a role to the user without logging in to Application Portal.
The existing roles of the user will be overwritten. It is suggested that you use Get User Roles API to query the existing roles of the user first.
Operation Permissions¶
In Application Portal, the application must be granted the “Authorize users in this OU” permission.
Request Format¶
POST https://{apigw-address}/app-portal-service/v2.2/role/appendRoles
Request Parameters (Body)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
organizationId |
Mandatory |
String |
The organization ID. How to get organizationld>> |
userId |
Mandatory |
String |
The user ID. |
roleIds |
Mandatory |
List |
The ID of the role to assign to the user. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
Boolean |
|
Error Codes¶
Code |
Description |
---|---|
31400 |
Errors such as incorrect parameters, empty parameters, character limits exceeded, and so on. |
31403 |
The application has not been granted the “Authorize users in this OU” permission. |
31404 |
Organization not found. |
Samples¶
Request Sample¶
url: https://{apigw-address}/app-portal-service/v2.2/role/appendRoles
method: POST
requestBody:
{"organizationId":"yourOrgId", "userId":"yourUserId","roleIds": ["role1","role2","role3"]}
Return Sample¶
{
"code": 0,
"message": "OK",
"data": true
}