Description

This web service is used to add Roles to existing User in an Organization. 

Parameters

The following parameters are required in this web service.


organizationId: Defines the Organization Id of an Organization where that user assigned new GenRocket roles.

username: Defines a unique username which will gives the existing user to be add new GenRocket roles.

roles: Defines the list of GenRocket roles that can be added to an existing user.  List of available roles are - ROLE_USER, ROLE_ORG_ADMIN,ROLE_WEB_SERVICE.


Add Roles curl command (Example) 

curl --insecure -H "accept:application/json" -H "Content-Type:application/json" -H "X-Auth-Token:XXXXXXX" -d '{organizationId:  "XXXXXXX-ddc9-481c-adad-XXXXXXXXXXXX",username: "email@email.com"roles: ['ROLE_ORG_ADMIN']}' https://app.genrocket.com/rest/user/addRole


URL Request

https://app.genrocket.com/rest/user/addRole


Payload Request (Example)

{
organizationId:  "XXXXXXX-ddc9-481c-adad-XXXXXXXXXXXX",
username: "email@email.com",
    "roles": 
    [
      "ROLE_ORG_ADMIN",
    ]

}


The payload request must include X-Auth-Token in header which was received using manager login for sessionId verification.


Payload OK Response (Example)

{
  "errors": {
  },
  "fields": {
   organizationId:  "XXXXXXX-ddc9-481c-adad-XXXXXXXXXXXX",
    "firstName": "ABC",
    "lastName": "XYZ",
    "username": "email@email.com",
    "enabled": true,
    "roles": 
    [
      "ROLE_ORG_ADMIN",
      "ROLE_USER"
    ]

  },
  "success": true
}