createRole
post
/ccstore/v1/roles
Creates a new organizational role. Optionally takes the X-CCOrganization header to specify current Organization context of logged in user.
Request
Supported Media Types
- application/json
Header Parameters
-
X-CCOrganization(optional): string
Current organization context of the logged in user
Root Schema : createRole_request
Type:
Show Source
object
-
accessRights(optional):
array accessRights
Access rights to assign to role
-
description(optional):
string
Description of role
-
function(optional):
string
Function for the organizationalRole. Possible values are - custom. Not allowed with type role.
-
name:
string
Name of role
-
relativeTo(optional):
object relativeTo
Organization for which the organizational role must be created. Required for type organizationalRole. Not allowed with type role.
-
repositoryId(optional):
string
Repository ID of role
-
type(optional):
string
Type of role to be created. Possible values are - role (default) and organizationalRole.
Example:
{
"name":"Custom Role",
"repositoryId":"customRole",
"description":"Custom Role",
"accessRights":[
{
"repositoryId":"customAccessRight1"
}
]
}
Nested Schema : relativeTo
Type:
object
Organization for which the organizational role must be created. Required for type organizationalRole. Not allowed with type role.
Show Source
-
id(optional):
string
Repository ID of organization
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository ID of access right
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : getRole_response
Type:
Show Source
object
-
accessRights(optional):
array accessRights
Access rights assigned to role
-
description(optional):
string
Description of role
-
function(optional):
string
Function name for organizationRole
-
id(optional):
string
ID of role
-
name(optional):
string
Name of role
-
relativeTo(optional):
object relativeTo
Related organization for organizationRole
-
repositoryId(optional):
string
Repository ID of role
-
type(optional):
string
Type of role (role or organizationalRole)
Nested Schema : relativeTo
Type:
object
Related organization for organizationRole
Show Source
-
externalOrganizationId(optional):
string
External organization id
-
id(optional):
string
Repository ID of related organization
Nested Schema : items
Type:
Show Source
object
-
description(optional):
string
Description of access right
-
displayName(optional):
string
Display name of access right
-
id(optional):
string
ID of access right
-
name(optional):
string
Name of access right
-
repositoryId(optional):
string
Repository ID of access right
-
type(optional):
string
Type of access right
Example Response (application/json)
{
"function":"custom",
"relativeTo":{
"id":"or-100001",
"externalOrganizationId":null
},
"name":"Custom Organizational Role",
"repositoryId":"customOrganizationalRole",
"description":"Custom Organizational Role",
"id":"customOrganizationalRole",
"accessRights":[
{
"displayName":"Custom Access Right",
"name":"Custom Access Right",
"repositoryId":"customAccessRight",
"description":"Custom Access Right",
"id":"customAccessRight",
"type":"generic"
}
],
"type":"organizationalRole"
}
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|
|------------------|------------------|
|22047|If input passed is invalid||
|22055|If type, relativeTo or function passed are invalid|
|22102|If a restricted privilege is being added to an organizationalRole|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
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(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code