Clone a Role

This API is used to clone a role.

URL: role-clone

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 existingName ** Name of the role to be cloned. String
Payload newName** Name of the cloned new role. String
Payload description** Description of the cloned role. String

** - Mandatory value

Possible Response Message and Code

HTTP Code Description Response Message
200 Ok Clone role successful.
404 Not Found Role Name to be cloned not found.
400 Bad Request The payload cannot be empty or null.
400 Bad Request Source Role Name can not be empty for clone action.
400 Bad Request Role name cannot be left empty or blank.
400 Bad Request Role name cannot be less than 2 characters.
400 Bad Request Role name cannot exceed 64 characters.
400 Bad Request Invalid Description.
400 Bad Request Source role and new role names cannot be empty.
409 Conflict ClonedRole Name already exists for the given RoleName.

Sample Request/Response

Use Case

Clone a role role_1 to create a new cloned role named clonerole_1.

Request URL

https://appviewxapi.com/avxapi/role-clone?gwkey=f000ca01;gwsource=external

Request Payload
 {
 "payload": {
 "existingName": "role_1",
 "newName": "clonerole_1",
 "description": "clone test role."
 }
 } 

Response

 {
 "response": "Clone role successful",
 "message": "Clone role successful",
 "appStatusCode": null,
 "tags": null,
 "headers": null
 }