addUserRoles
post
/ccadmin/v1/profiles/{id}/addRoles
add User Roles. This operation is used to add the roles for the profile w.r.t the associations specified.
Request
Supported Media Types
- application/json
Path Parameters
Header Parameters
-
X-CCAsset-Language: string
The asset language of the request
Root Schema : addRoles_request
Type:
Show Source
object
-
roles(required):
array roles
List of roles to associate with the user.
Example:
{
"roles":[
{
"associations":[
{
"relatedItemId":"or-100001",
"type":"organization"
}
],
"id":"role-100001"
},
{
"associations":[
{
"relatedItemId":null,
"type":"global"
}
],
"id":"role-100002"
}
]
}
Nested Schema : items
Type:
Show Source
object
-
associations:
array associations
-
id:
string
Repository ID of the role to be assigned.
Nested Schema : items
Type:
Show Source
object
- relatedItemId: string
-
type:
string
If the role is to be assigned in organization scope the type is (organization) and if the role is global scope the type is (global).
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : addRoles_response
Type:
Show Source
object
-
success:
boolean
Returns true if the action performed successfully.
Example Response (application/json)
{
"success":true,
"links":[
{
"rel":"self",
"href":"http://localhost:9080/ccadminui/v1/profiles/bb-110000/addRoles"
}
]
}
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 adding roles to the user.|
|22020|If roles provided is empty or null.
|13037|If the required property is missing in the request.
|22055|If roles provided is not in correct format.|
|89014|If roles provided contains an accessRight with privilege.|
|22002|If profile id passed is invalid.|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage:
string
An optional non-localized message containing technical information for developers
-
errorCode:
string
The numerical code identifying the error
-
errors:
array errors
An optional list of errors if multiple errors were encountered
-
message:
string
The localized message describing the error
-
moreInfo:
string
An optional non-localized message with more information
-
o:errorPath:
string
An optional machine readable description of where the error occurred
-
status:
string
The HTTP status code
-
type:
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage:
string
An optional non-localized message containing technical information for developers
-
errorCode:
string
The numerical code identifying the error
-
message:
string
The localized message describing the error
-
moreInfo:
string
An optional non-localized message with more information
-
o:errorPath:
string
An optional machine readable description of where the error occurred
-
status:
string
The HTTP status code