Invoking Oracle cloud RESTful web-services
Web services are the gateway for all data exchange in the cloud world and it is no different for Oracle cloud. There is quite a collection of RESTful endpoints exposed by the HCM offering and the collection seems to get better with new releases. With R13 exposing RESTful web-services for ERP cloud too.
In the following example we will see how to update an employee information using HCM’s RESTful endpoints. More about it can be learned here.
To update an employee first we need to get the employee and each employee is uniquely identified using an ID(empsUniqID), which in this case in not the employee-ID or SSN but it is obtained using those values are query params. See below to see how to invoke that using Postman :
Notice how we are querying using the employee ID to get empsUniqID:
emps?q=PersonNumber=1234567
The GET request above will get you all the details about the employee, but what we are interested in is in the empsUniqId, which can be found in the links section :
It is the 196 character long number after the emps/ part.
Now that you have the empsUniqId, you can use it to update the employee using a PATCH request as shown below.
As you can see the empsUniqId in the URL and it is also important to set the content type in the header information to :
application/vnd.oracle.adf.resourceitem+json
The fields you need to update for the employee needs to be passed in the body as JSON. Sending the PATCH request would give you as 200 OK status if the call was successful and you would also get the entire employee info as JSON back to verify that your data was rightly updated. Some fields may not be updated in such case they will remain unchanged.
Hopefully this post helps you with interacting with Oracle cloud HCM REST endpoints. Please don’t hesitate to post any questions or comments.