Associate Roles to a User Group
This API is used to associate or disassociate one or more roles to a user group.
URL: /usergroup-updateRoles
Type: PUT
Parameters
| Param | TypeName | Description | Field Type |
|---|---|---|---|
Header |
sessionId** (or) Token** | Use either Session Id or Token received after login. | String |
Query |
gwkey | Tenant Key. Needed only in case of multi-tenant installations. | String |
Query |
gwsource** | Source from which the request is triggered (for example, web, external). | String |
Payload |
assignRoles | An array of role names to assign. | Array |
Payload |
unassignRoles | An array of role names to unassign. | Array |
Payload |
name** | Name of the user-group for consideration. | string |
** - Mandatory value
Note: Even if the assignRoles and unassignRoles contain invalid role
names that cannot be processed, the API would still go-ahead to assign/unassign any role in
the list that can be successfully processed.
Possible Response Message and Code
| HTTP Code | Description | Response Message |
|---|---|---|
| 400 | Bad request | Usergroup Name cannot be null or empty. |
| 200 | OK | Updating user group with role(s) successful TBD – Change text, multiple cases. |
Sample Request/Response
Use Case
role_1, role_2, and role_3 are existing in the application. role_1 and role_2 have to be assigned to the user group appviewx_usergroup and role_3 has to be unassigned.
Request URL
https://appviewxapi.com/avxapi/platform-assign-roles-to-usergroup?gwkey=f000ca01&gwsource=external
Request Payload
{
"payload" : {
"userGroupName": "UG1", "assignedRoles": ["R1"], "unassignedRoles": []
}
}
Response
{
"response": "success",
"message": null,
"appStatusCode": null,
"tags": null,
"headers": null
}