Introduction:
This blog has the REST API details that can be used to update worker assignment details in Oracle Cloud application.
Cause of the issue:
Business wants to integrate their Workday application with Oracle Cloud to sync the employee details. So, whenever there is a new employee created or existing employee details updated in Workday application, business wants to import them in Oracle Cloud as well.
How do we solve:
Oracle provides a REST API which can be used to update workers assignment in Oracle Cloud in the form of payload. REST API responds with import status and error details in case of failure. Below is the sample payload used to update workers assignment.
STEP 1: Get Worker’s Assignment URL
End Point URL:
https://fa-eotw-dev3-saasfaprod1.fa.ocs.oraclecloud.com:443/hcmRestApi/resources/11.13.18.05/workers?q=PersonNumber=WD000001 &expand=workRelationships.assignments
EndPoint URL Parameter: PersonNumber=WD000001
Method: GET
Authentication: Basic
Username: username@xxcomp.com
Password: Password
Response:
From the response data, under “assignments” array, pick “href” value where “rel”=”self” & “name”=”assignments” for the active date record range and “PrimaryFlag”=”true to get update Assignment EndPoint URL.
STEP 2: Update Worker Assignment
End Point URL:
Method: PATCH
Custom Header Attribute:
Header Attribute Name | Value | Mapping |
Effective-Of | RangeMode=UPDATE;RangeStartDate=2023-10-28;RangeEndDate=4712-12-31 | RangeMode – Default to “UPDATE”
RangeStartDate – Default to system current date RangeEndDate – Default to 4712-12-31 |
Authentication: Basic
Username: username@rcubedco.com
Password: Password
Sample Payload for Expense Account Change:
{
“ActionCode”: “ASG_CHANGE”,
“DefaultExpenseAccount”: “1001-64020-30050-9999-99999-99999-9999-99999”
}
Sample Payload for Expense Account Change:
{
“ActionCode”: “JOB_CHANGE”,
“JobCode”: “Level_2”
}
Response:
The response will have the status code along with created data.
- The status code will be “200 OK” if the update process is successful.
- Other than “200 OK”, any other status codes should be treated as failed.