listRoles associated with a profile
get
/ccadmin/v1/profiles/{id}/roles
List Roles. Get all roles associated for shoppers.
Request
Supported Media Types
- application/json
Path Parameters
-
id(required): string
The customer profile id.
Query Parameters
-
limit: string
The maximum number of roles to be returned from this request.
-
offset: string
The starting offset/index to be returned from this request.
-
q: string
Query string that filters the roles to be returned from this request using SCIM filtering syntax.
-
sort: string
The sort order of the list to be returned from this request.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : getRoles_response
Type:
Show Source
object
-
limit:
integer
Number of records to be fetched.
-
offset:
integer
The offset
-
properties:
array properties
list of roles associated with the profile
-
total:
integer
Total number of records present in database matching the searched string.
-
totalResults:
integer
The total number of records fetched.
Example:
{
"roles":[
{
"associations":[
{
"relatedItemId":"or-100001",
"type":"organization"
}
],
"repositoryId":"100037",
"name":"Buyer",
"description":null,
"id":"role-100001",
"accessRights":[
],
"type":"organizationalRole",
"category":{
"displayName":"Storefront Roles",
"repositoryId":"storefrontRoleCategory",
"id":"storefrontRoleCategory"
}
},
{
"associations":[
{
"relatedItemId":null,
"type":"global"
}
],
"name":"testRole",
"description":"testRole",
"id":"role-100002",
"accessRights":[
{
"displayName":"Sample AccessRight",
"repositoryId":"300001",
"name":"Sample AccessRight",
"id":"Sample AccessRight",
"type":"generic"
}
],
"type":"role",
"category":{
"displayName":"Custom Roles",
"repositoryId":"customRoleCategory",
"id":"customRoleCategory"
}
}
]
}
Nested Schema : items
Type:
Show Source
object
-
accessRights:
array accessRights
Access rights assigned to role
-
associations:
array associations
-
category:
object category
Category of the role
-
description:
string
Description of role
-
function:
string
Function name for organizationRole
-
id:
string
ID of the role to be assigned.
-
name:
string
Name of role
-
relativeTo:
object relativeTo
Related organization for organizationRole
-
repositoryId:
string
Repository ID of the role
Nested Schema : category
Type:
object
Category of the role
Show Source
-
displayName:
string
Display name of the role category.
-
id:
string
ID of the role category.(customRoleCategory or storefrontRoleCategory)
-
repositoryId:
string
Repository ID of the role category.(customRoleCategory or storefrontRoleCategory)
Nested Schema : relativeTo
Type:
object
Related organization for organizationRole
Show Source
-
repositoryId:
string
Repository ID of related organization
Nested Schema : items
Type:
Show Source
object
-
displayName:
string
Display name of access right
-
id:
string
ID of access right
-
name:
string
Name of access right
-
repositoryId:
string
Repository ID of access right
-
type:
string
Type of access right
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).
Example Response (application/json)
{
"total":"2",
"totalResults":"2",
"offset":"0",
"limit":"250",
"items":[
{
"associations":[
{
"relatedItemId":"or-100001",
"type":"organization"
}
],
"function":"admin",
"relativeTo":{
"repositoryId":"or-100001"
},
"repositoryId":"100001",
"name":"Administrator",
"description":null,
"id":"100001",
"accessRights":[
{
"displayName":null,
"repositoryId":"updateAccountAddress",
"name":"Update Account Address",
"id":"updateAccountAddress",
"type":"generic"
},
{
"displayName":null,
"repositoryId":"createAccountAddress",
"name":"Create Account Address",
"id":"createAccountAddress",
"type":"generic"
}
],
"type":"organizationalRole",
"category":{
"displayName":"Storefront Roles",
"repositoryId":"storefrontRoleCategory",
"id":"storefrontRoleCategory"
}
},
{
"associations":[
{
"relatedItemId":null,
"type":"global"
},
{
"relatedItemId":"or-100001",
"type":"organization"
},
{
"relatedItemId":"or-100002",
"type":"organization"
}
],
"repositoryId":"200001",
"name":"Example1",
"description":"Sample Description",
"id":"200001",
"accessRights":[
{
"displayName":"Sample AccessRight",
"repositoryId":"300001",
"name":"Sample AccessRight",
"id":"Sample AccessRight",
"type":"generic"
}
],
"type":"role",
"category":{
"displayName":"Custom Roles",
"repositoryId":"customRoleCategory",
"id":"customRoleCategory"
}
}
]
}
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 fetching roles for the user.|
|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