Create a role assignment
post
/hcmRestApi/resources/11.13.18.05/userAccounts/{GUID}/child/userAccountRoles
Request
Path Parameters
-
GUID(required): string
The value of this parameter could be a hash of the key that is used to uniquely identify the resource item. The client should not generate the hash key value. Instead, the client should query on the collection resource with a filter to navigate to a specific resource item. For example: products?q=InventoryItemId=
Header Parameters
-
Metadata-Context:
If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
-
REST-Framework-Version:
The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
Supported Media Types
- application/json
Root Schema : schema
Type:
Show Source
object
-
RoleCode: string
Title:
Role Code
Maximum Length:240
Technical name used to search for a specific role. -
RoleId: integer
(int64)
Title:
Role ID
Unique identifier of a role. -
UserRoleId: integer
(int64)
Title:
User Role ID
Unique identifier of the user role.
Response
Supported Media Types
- application/json
Default Response
The following table describes the default response for this task.
Headers
-
Metadata-Context:
If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
-
REST-Framework-Version:
The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
Root Schema : userAccounts-userAccountRoles-item-response
Type:
Show Source
object
-
CreatedBy: string
Title:
Created By
Read Only:true
Maximum Length:64
User who created the user account role assignment. -
CreationDate: string
(date-time)
Title:
Creation Date
Read Only:true
Date and time when the user account role assignment was created. -
LastUpdateDate: string
(date-time)
Title:
Last Update Date
Read Only:true
Date and time when the user account role assignment was last updated. -
LastUpdatedBy: string
Title:
Last Updated By
Read Only:true
Maximum Length:64
User who last updated the user account role assignment. -
links: array
Links
Title:
Links
The link relations associated with the resource instance. -
RoleCode: string
Title:
Role Code
Maximum Length:240
Technical name used to search for a specific role. -
RoleId: integer
(int64)
Title:
Role ID
Unique identifier of a role. -
UserRoleId: integer
(int64)
Title:
User Role ID
Unique identifier of the user role.
Nested Schema : Links
Type:
array
Title:
Links
The link relations associated with the resource instance.
Show Source
Nested Schema : link
Type:
Show Source
object
-
href: string
Title:
hyperlink reference
The URI to the related resource. -
kind: string
Title:
kind
Allowed Values:[ "collection", "item", "describe", "other" ]
The kind of the related resource. -
name: string
Title:
name
The name of the link to the related resource. -
properties: object
properties
-
rel: string
Title:
relation
Allowed Values:[ "self", "lov", "parent", "canonical", "child", "enclosure", "action", "custom" ]
The name of the relation to the resource instance. Example: self.
Nested Schema : properties
Type:
Show Source
object
-
changeIndicator: string
Change indicator or the ETag value of the resource instance.
Examples
The following example shows how to create a role assignment by submitting a POST request on the REST resource using cURL.
curl -i -u "<username>:<password>" -H "Content-Type: application/vnd.oracle.adf.resourceitem+json" -X POST -d <payload> "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/userAccounts/8A8D6884309FD869E050F50A9C4E9A00/child/userAccountRoles"
Example of Payload
The following is an example of the payload.
{ "RoleId":5071 }
Example of Response Header
The following is an example of the response header.
Status: HTTP/1.1 201 Created Content-Type: application/vnd.oracle.adf.resourceitem+json
Example of Response Body
The following example shows the contents of the response body in JSON format.
{ "UserRoleId" : 300100185546705, "RoleId" : 5071, "RoleCode" : "ORA_PER_LINE_MANAGER_ABSTRACT", "CreatedBy" : "HR_SPEC_ALL", "CreationDate" : "2019-06-10T20:51:59+00:00", "LastUpdatedBy" : "HR_SPEC_ALL", "LastUpdateDate" : "2019-06-10T20:52:01.446+00:00", "links": [ { ...} ] }