Add a Role
This API is used to add a new role to the system.
URL: /role
Type: POST
Parameters
| Param Type | Name | 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 |
name** | Name of the role. | String |
Payload |
description | Description of the role | String |
** - Mandatory value
Possible Response Message and Code
| HTTP Code | Description | Response Message |
|---|---|---|
| 400 | Bad request | Role name cannot be left empty or blank. |
| 201 | Created | Role added successfully |
| 409 | Conflict | Role Name Already Exists. |
Sample Request/Response
Use Case
Add a role with a valid role name.
Request URL
https://appviewxapi.com/avxapi/role?gwkey=f000ca01&gwsource=external
Request Payload
{
"payload": {
"name":"role_1",
"description":"Adding a new role"
}
}
Response
{
"response": "Role added successfully",
"message": "Role added successfully",
"appStatusCode": null,
"tags": null,
"headers": null
}