Oracle by Example brandingGet Started with Workers REST API - Manage Worker's Employment Information

section 0Before You Begin

This 20-minute tutorial shows you how to make changes to a worker's employment information.

All employment changes are date effective updates or corrections and require an action code.


section 1Add a Singular Resource to a Collection

  1. Add a request to ##_WorkersCollection.

  2. Give the request the name Add Manager.
  3. Click Save to ##_WorkersCollection.
  4. Specify the method as POST.
  5. Enter the url for the managers collection or {{Managers_href}} if you set global variables:

    {{url}}/hcmRestApi/resources/11.13.18.05/workers/{id}/child/workRelationships/{id}/child/assignments/{id}/child/managers

  6. Give the request the following headers:

    Key Value
    REST-Framework-Version 4
    Content-Type application/vnd.oracle.adf.resourceitem+json
    effective-Of RangeStartDate={{4DaysAhead}}
  7. 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 manager assignment number.

    Request Body:

    {
        "ManagerAssignmentNumber": "E955160008194454",
        "ManagerType": "LINE_MANAGER",
        "ActionCode": "MANAGER_CHANGE"
    }
  8. Click Send.

  9. Click Save.

section 2Update a Singular Resource

  1. Add a request to ##_WorkersCollection.

  2. Give the request the name Update Work Location.
  3. Click Save to ##_WorkersCollection.
  4. Specify the method as POST.
  5. Enter the url for the assignment item or {{Assignment_href}} if you set global variables:

    {{url}}/hcmRestApi/resources/11.13.18.05/workers/{id}/child/workRelationships/{id}/child/assignments/{id}

  6. Give the request the following headers:

    Key Value
    REST-Framework-Version 4
    Content-Type application/vnd.oracle.adf.resourceitem+json
    effective-Of RangeMode=UPDATE;RangeStartDate={{5DaysAhead}};RangeEndDate=4712-12-31
  7. Add the request body. None is selected by default, raw must be used to add content.

    Request Body:

    {
        "BusinessUnitName": "Vision Central",
        "LocationCode": "ComUSHQ",
        "ActionCode": "LOCATION_CHANGE"
    }
  8. Click Send.

  9. Click Save.

section 2Perform an Action on a Worker

Some of the commonly performed employment actions have been delivered as custom actions to simplify a multi-step process, or to perform the actions that can't be performed directly via the standard HTTP methods.

Actions have a different content type than resources (application/vnd.oracle.adf.action+json).

  1. Add a request to ##_WorkersCollection.

  2. Give the request the name Add a Temporary Assignment.
  3. Click Save to ##_WorkersCollection.
  4. Specify the method as POST.
  5. Enter the url for the assignment item or {{Assignment_href}} if you set global variables:

    {{url}}/hcmRestApi/resources/11.13.18.05/workers/{id}/child/workRelationships/{id}/child/assignments/{id}

  6. Give the request the following headers:

    Key Value
    REST-Framework-Version 4
    Content-Type application/vnd.oracle.adf.action+json
  7. Add the request body. None is selected by default, raw must be used to add content.

    Request Body:

    {
    "actionCode":"TEMP_ASG" ,
    "effectiveDate":"{{5DaysAhead}}" ,
    "businessUnitName":"BusinessUnit2"
    }
  8. Click Send.

  9. Click Save.

more informationWant to Learn More?