updateUserRoles

post

/ccadmin/v1/profiles/{id}/updateUserRoles

Update User Roles. This operation is used to update the roles for the profile. Optionally takes the x-ccasset-language header to get translated content in another language.

Request

Supported Media Types
  • application/json
Path Parameters
id
Type: string
Required: true
Header Parameters
X-CCAsset-Language
Type: string
The asset language of the request
Body Parameter
Root Schema : updateUserRoles_request
Nested Schema : roles
Type: array
List of role's function that need to associate with the user.
Nested Schema : items
Type: object
Nested Schema : relativeTo
Type: object
If not provided organization id will be cosidered as its parent organization ID

Response

Supported Media Types
  • application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : updateUserRoles_response
Example application/json

{
    "success":true,
    "links":[
        {
            "rel":"self",
            "href":"http://localhost:9080/ccadminui/v1/profiles/bb-110000/updateUserRoles"
        }
    ],
    "message":"Roles has been updated successfully."
}
Default Response
The error response. The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud: |Error Code|Description| |------------------|------------------| |22019|If some internal error occurs while updating roles to the user.| |1002017|If user tries to update roles for non b2b users.| |22020|If roles provided is empty or null.| |89008|If roles with op as remove from input is not available for the profile.| |22023|If invalid op is passed in roles input.| |89007|If other organization roles which are not associated to the profile is passed in input.| |22002|If profile id passed is invalid.| |89005|If user tries to remove the buyer roles.| |22007|If roles input provided is invalid.| |89001|If invalid organization role(s) are passed.|
Body
Root Schema : errorModel
Type: object
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Nested Schema : items
Type: object

Examples

Sample Request:

{"roles": [
  {
    "op": "add",
    "function": "approver",
    "relativeTo": {"id": "200002"}
  },
  {
    "op": "remove",
    "function": "admin",
    "relativeTo": {"id": "200002"}
  }
]}

Sample Response Payload returned by endpoint:

{
  "success": true,
  "links": [{
    "rel": "self",
    "href": "http://localhost:9080/ccadminui/v1/profiles/bb-110000/updateUserRoles"
  }],
  "message": "Roles has been updated successfully."
}