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

section 0Before You Begin

This 20-minute tutorial shows you how to create, modify, and delete a worker's person information.


section 1Add a Singular Resource to a Collection

Create a Singular Resource

  1. Add a request to ##_WorkersCollection.

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

    {{url}}/hcmRestApi/resources/11.13.18.05/workers/{id}/child/nationalIdentifiers

  6. Give the request the following headers:

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

    Request Body:

    {     
        "LegislationCode": "US",
        "NationalIdentifierType": "SSN",
        "NationalIdentifierNumber": "###-##-1234",
        "PrimaryFlag":true
    }
  8. Click Send.

  9. Click Save.

Create a Date Effective Singular Resource

  1. Add a request to ##_WorkersCollection.

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

    {{url}}/hcmRestApi/resources/11.13.18.05/workers/{id}/child/addresses

  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.

    Request Body:

    {
        "AddressType":"MAIL",
        "AddressLine1":"100 Bell Drive",
        "TownOrCity":"FREMONT",
        "Region1":"Alameda",
        "Region2":"CA",
        "Region3":"Bay Area",
        "PostalCode":"94539",
        "Country":"US",
        "PrimaryFlag":false
    }
  8. Click Send.

  9. Click Save.

section 2Update a Singular Resource

Update a Singular Resource

  1. Add a request to ##_WorkersCollection.

  2. Give the request the name Update Phone Number.
  3. Click Save to ##_WorkersCollection.
  4. Specify the method as PATCH.
  5. Enter the url for the phones tiem or {{Phone_href}} if you set global variables:

    {{url}}/hcmRestApi/resources/11.13.18.05/workers/{id}/child/phones/{id}

  6. Give the request the following headers:

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

    Request Body:

    {
    "PhoneNumber":"4449876"
    }
  8. Click Send.

  9. Click Save.

Update a Date Effective Singular Resource

When updating a date effective resource, you must specify a RangeStartDate that is different than the effective date of the resource.

  1. Add a request to ##_WorkersCollection.

  2. Give the request the name Update Address.
  3. Click Save to ##_WorkersCollection.
  4. Specify the method as PATCH.
  5. Enter the url for the addresses collection or {{Address_href}} if you set global variables:

    {{url}}/hcmRestApi/resources/11.13.18.05/workers/{id}/child/addresses/{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:

    {
        "AddressLine1":"10023 Bell Drive",
        "AddressLine2":"APT 506"
    }
  8. Click Send.

  9. Click Save.

Correct a Date Effective Singular Resource

  1. Add a request to ##_WorkersCollection.

  2. Give the request the name Correct Address.
  3. Click Save to ##_WorkersCollection.
  4. Specify the method as PATCH.
  5. Enter the url for the addresses collection or {{Address_href}} if you set global variables:

    {{url}}/hcmRestApi/resources/11.13.18.05/workers/{id}/child/addresses/{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:

    {
        "AddressLine1":"10023 Bell Drive",
        "AddressLine2":"APT 506"
    }
  8. Click Send.

  9. Click Save.

section 3Delete a Singular Resource

  1. Add a request to ##_WorkersCollection.

  2. Give the request the name Delete Email Address.
  3. Click Save to ##_WorkersCollection.
  4. Specify the method as Delete.
  5. Enter the url for the email item or {{extra_email_href}} if you set global variables:

    {{url}}/hcmRestApi/resources/11.13.18.05/workers/{id}/child/emails/{id}

  6. Click Send.

    The request should produce a 204 No Results response. You can re-run your get worker to verify the email address has been deleted.

  7. Click Save.

next stepNext Tutorial

Managing a Workers Employment Information Using Workers REST API