Before You Begin
This 20-minute tutorial shows you how to create a pending worker and an employee.
Before you begin, you should know the Manager Assignment Number, Legal Employer Name, Business Unit Name, and Location Code for your environment. Any other objects may be added or modified, as appropriate.
Create a Worker
Add a request to ##_WorkersCollection.
- Give the request the name Create Employee.
- Click Save to ##_WorkersCollection.
- Specify the method as POST.
Enter the url:
{{url}}/hcmRestApi/resources/latest/workers
Give the request the following headers:
Note: Headers can be saved in presets in postman for reuse.
Key Value REST-Framework-Version 4 Content-Type application/vnd.oracle.adf.resourceitem+json effective-Of RangeStartDate={{4DaysAhead}} Add the request body. None is selected by default, raw must be used to add content.
Value replacements will need to be made in the body for your legal employer, business unit, location code, and any other values you would like to replace.
Request Body:
{ "DateOfBirth":"1997-01-01", "names":[{ "LastName": "##_LastName_{{$timestamp}}", "FirstName":"##_FirstName", "MiddleNames":"##", "LegislationCode": "US" }], "emails":[ { "EmailType": "H1", "EmailAddress": "##_H1_{{$timestamp}}@oracle.com", "PrimaryFlag":false, "FromDate": "{{5DaysAhead}}" }, { "EmailType": "H1", "EmailAddress": "##_H1_02_{{$timestamp}}@oracle.com", "PrimaryFlag":false, "FromDate": "{{5DaysAhead}}" }, { "EmailType": "W1", "EmailAddress": "##_Work_{{$timestamp}}@oracle.com", "PrimaryFlag":true }], "phones":[{ "PhoneType": "W1", "LegislationCode":"US", "PhoneNumber": "3333333", "AreaCode":"510", "CountryCodeNumber":"1", "FromDate": "{{5DaysAhead}}", "PrimaryFlag":false }, { "PhoneType": "H1", "PhoneNumber": "1111111", "AreaCode":"408", "CountryCodeNumber":"1", "LegislationCode":"US", "FromDate": "{{5DaysAhead}}", "PrimaryFlag":true }, { "PhoneType": "H1", "PhoneNumber": "2222222", "AreaCode":"408", "CountryCodeNumber":"1", "LegislationCode":"US", "PrimaryFlag":false }], "addresses":[{ "AddressType":"HOME", "AddressLine1":"101 Main Street", "TownOrCity":"Suwanee", "Region1":"Gwinnett", "Region2":"GA", "PostalCode":"30024", "Country":"US", "PrimaryFlag":true }], "ethnicities": [{ "LegislationCode": "US", "Ethnicity": "7", "PrimaryFlag":true }], "workRelationships":[{ "LegalEmployerName": "LegalEmployer", "WorkerType": "E", "EnterpriseSeniorityDate":"{{5DaysAhead}}", "LegalEmployerSeniorityDate":"{{5DaysAhead}}", "PrimaryFlag":true, "assignments":[{ "BusinessUnitName": "BusinessUnit", "ActionCode": "HIRE_ADD_WORK_RELATION", "LocationCode": "LOC", "workMeasures":[{ "Value": 1.5, "Unit": "FTE" }, { "Value": 1, "Unit": "HEAD" }] }] }] }
Click Send.
The response should be 201 Created. Make a note of the PersonId, PersonNumber, and AssignmentNumber.
- Click Save.
Click Save Response > Save as example.
- Name the example ## Test Env Create Employee.
Click Save Example.
The request and response can now be referenced, if necessary.
Create a Pending Worker
Creating a Pending Worker
Add a request to ##_WorkersCollection.
- Give the request the name Create Pending Worker.
- Click Save to ##_WorkersCollection.
- Specify the method as POST.
Enter the url:
{{url}}/hcmRestApi/resources/latest/workers
Give the request the following headers:
Note: Headers can be saved in presets in postman for reuse.
Key Value REST-Framework-Version 4 Content-Type application/vnd.oracle.adf.resourceitem+json effective-Of RangeStartDate={{dateStamp}} Add the request body. None is selected by default, raw must be used to add content.
Value replacements will need to be made in the body for your legal employer, business unit, location code, manager assignment number and any other values you would like to replace.
Request Body:
{ "DateOfBirth":"1997-01-01", "names":[{ "LastName": "##_LastName_PND_{{$timestamp}}", "FirstName":"##_FirstName", "MiddleNames":"##", "LegislationCode": "US" }], "emails":[ { "EmailType": "H1", "EmailAddress": "##_H1_PND_{{$timestamp}}@oracle.com", "PrimaryFlag":false, "FromDate": "{{4DaysAhead}}" }, { "EmailType": "H1", "EmailAddress": "##_H1_PND_02_{{$timestamp}}@oracle.com", "PrimaryFlag":false, "FromDate": "{{4DaysAhead}}" }, { "EmailType": "W1", "EmailAddress": "##_Work_PND_{{$timestamp}}@oracle.com", "PrimaryFlag":true }], "phones":[{ "PhoneType": "W1", "LegislationCode":"US", "PhoneNumber": "3334444", "AreaCode":"510", "CountryCodeNumber":"1", "FromDate": "{{4DaysAhead}}", "PrimaryFlag":false }, { "PhoneType": "H1", "PhoneNumber": "1114444", "AreaCode":"408", "CountryCodeNumber":"1", "LegislationCode":"US", "FromDate": "{{4DaysAhead}}", "PrimaryFlag":true }, { "PhoneType": "H1", "PhoneNumber": "2224444", "AreaCode":"408", "CountryCodeNumber":"1", "LegislationCode":"US", "PrimaryFlag":false }], "addresses":[{ "AddressType":"HOME", "AddressLine1":"102 Main Street", "TownOrCity":"Suwanee", "Region1":"Gwinnett", "Region2":"GA", "PostalCode":"30024", "Country":"US", "PrimaryFlag":true }, { "AddressType":"MAIL", "AddressLine1":"101 Bell Drive", "TownOrCity":"FREMONT", "Region1":"Alameda", "Region2":"CA", "Region3":"Bay Area", "PostalCode":"94539", "Country":"US", "PrimaryFlag":false }], "ethnicities": [{ "LegislationCode": "US", "Ethnicity": "7", "PrimaryFlag":true }], "workRelationships":[{ "LegalEmployerName": "LegalEmployer", "WorkerType": "P", "PrimaryFlag":false, "assignments":[{ "BusinessUnitName": "BusinessUnit", "LocationCode": "LOC", "ActionCode": "ADD_PEN_WKR", "ReasonCode":"PENDWKR", "ProposedUserPersonType": "Employee", "ProjectedStartDate": "{{4DaysAhead}}", "UserPersonType": "Pending Worker", "AssignmentName":"Accounting", "AssignmentNumber":"E12345678", "managers":[{ "ManagerAssignmentNumber": "E1224567", "ManagerType": "LINE_MANAGER" }], "workMeasures":[{ "Value": 1.5, "Unit": "FTE" }, { "Value": 1, "Unit": "HEAD" }] }] }] }
Click Send.
The response should be 201 Created. Make a note of the PersonId, PersonNumber, and AssignmentNumber. Additionally, copy the link for the workRelationships item as you will need them for the next exercises.
- Click Save.
Click Save Response > Save as example.
- Name the example ## Test Env Create Employee.
Click Save Example.
The request and response can now be referenced, if necessary.
- Save the request.
Set the Ready to Convert Flag
Setting the ready to convert flag is an update to the workRelationship singular resource. To complete this exercise you will need the workRelationship item link from the pending worker's record. If you did not save the results, the next exericse can be used to retrieve the worker record to get the link.
Add a request to ##_WorkersCollection.
- Give the request the name Set Ready to Convert Flag.
- Click Save to ##_WorkersCollection.
- Specify the method as POST.
Enter the url:
{{url}}/hcmRestApi/resources/latest/workers/{Id}/child/workRelationships/{Id}
Give the request the following headers:
Key Value REST-Framework-Version 4 Content-Type application/vnd.oracle.adf.resourceitem+json Add the request body. None is selected by default, raw must be used to add content.
Request Body:
{ "ReadyToConvertFlag":true }
Send the request.
The ReadyToConvertFlag should now be true in the response body.
- Save the request.