POST

This table shows the required date effective header parameters and the criteria to perform a POST operation on date effective objects.

Header Attribute Applicable Required Default Value Criteria

RangeStartDate

Yes

No

Context date or Sysdate

When a POST operation is performed on a root resource, RangeStartDate defaults to the sysdate if not provided by the user.

When a POST operation is performed on a child resource, RangeStartDate defaults to the context date (effectiveDate parameter in the resource URL), if not provided by the user.

RangeEndDate

Yes

No

EOT

If RangeEndDate is not provided, it defaults to end-of-time.

If user is allowed to end date an object (such as visa), and RangeEndDate is provided during the POST operation, then the object is end-dated with the specified end date.

RangeMode

No

NA

NA

NA

RangeSpan

No

NA

NA

NA

RangeStartSequence (MCPD only)

No

NA

NA

NA

RangeEndSequence(MCPD only)

No

NA

NA

NA

Examples

Let's look at some examples of POST operations performed on the workers resource and its child resources to create records for date effective objects.

Example 1

Let's create a worker record without providing the effective-Of header attribute.

  1. Perform a POST operation on the workers resource using this URL format.
    POST
    
    /hcmRestApi/resources/11.13.18.05/workers

    Header

    REST-Framework-Version : 4
    Content-Type : application/vnd.oracle.adf.resourceitem+json

    Sample Request

    {
      "names": [
        {
          "LastName": "Doe",
          "LegislationCode": "US"
        }
      ],
      "workRelationships": [
        {
          "LegalEmployerName": "GBI HCM Widgets USA",
          "WorkerType": "E",
          "assignments": [ 
            {
              "ActionCode": "HIRE",
              "BusinessUnitName": "GBI HCM-Financials USA BU"
            }
          ]
        }
      ]
    }
  2. Verify the details returned in the response. The worker record and all its date effective child objects are created with EffectiveStartDate same as sysdate.

Example 2

Let's create a worker record by providing the effective-Of header attribute.

  1. Perform a POST operation on the workers resource using this URL format and providing the RangeStartDate in the effective-Of header attribute.
    POST
    
    /hcmRestApi/resources/11.13.18.05/workers

    Header

    REST-Framework-Version : 4
    Content-Type : application/vnd.oracle.adf.resourceitem+json
    effective-Of : RangeStartDate=2017-01-01

    Sample Request

    {
      "names": [
        {
          "LastName": "Martineau",
          "LegislationCode": "US"
        }
      ],
      "workRelationships": [
        {
          "LegalEmployerName": "Vision Corporation",
          "WorkerType": "E",
          "assignments": [ 
            {
              "ActionCode": "HIRE",
              "BusinessUnitName": "Vision Central"
            }
          ]
        }
      ]
    }
  2. Verify the details returned in the response. The worker record and all its date effective child objects are created with EffectiveStartDate of 2017-01-01.

Example 3

Let's get a worker record without providing the context date and obtain the legislativeInfo child collection to create a legislative record.

  1. Retrieve the worker record by performing a GET operation on the workers resource using this URL format.
    GET
    
    /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}
  2. Obtain the legislativeInfo child collection link from the response.
  3. Perform a POST operation on the legislativeInfo child collection without providing the effective-Of header attribute.
    POST
    
    /hcmRestApi/resources/11.13.18.05/workers/{PersonId}/child/legislativeInfo

    Header

    REST-Framework-Version : 4
    Content-Type : application/vnd.oracle.adf.resourceitem+json

    Sample Request

    {
      "LegislationCode": "CA"
    }
  4. Verify the details returned in the response. The legislative record is created with EffectiveStartDate same as sysdate.

Example 4

Let's get a worker record effective as of 2018-01-01 and obtain the legislativeInfo child collection to create a legislative record.

  1. Retrieve the worker record by performing a GET operation on the workers resource, providing the effectiveDate parameter in the URL.
    GET
    
    /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2018-01-01
  2. Obtain the legislativeInfo child collection link from the response.
  3. Perform a POST operation on the legislativeInfo child collection without providing the effective-Of header attribute.
    POST
    /hcmRestApi/resources/11.13.18.05/workers/{PersonId}/child/legislativeInfo

    Header

    REST-Framework-Version : 4
    Content-Type : application/vnd.oracle.adf.resourceitem+json

    Sample Request

    {
      "LegislationCode": "CA"
    }
  4. Verify the details returned in the response. The legislative record is created with EffectiveStartDate of 2018-01-01.

Example 5

Let's get a worker record effective as of 2018-01-01 and obtain the legislativeInfo child collection to create a legislative record by providing the RangeStartDate.

  1. Retrieve the worker record by performing a GET operation on the workers resource, providing the effectiveDate parameter in the URL.
    GET
    
    /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2018-01-01
  2. Obtain the legislativeInfo child collection link from the response.
  3. Perform a POST operation on the legislativeInfo child collection by providing the RangeStartDate in the effective-Of header attribute.
    POST
    
    /hcmRestApi/resources/11.13.18.05/workers/{PersonId}/child/legislativeInfo

    Header

    REST-Framework-Version : 4
    Content-Type : application/vnd.oracle.adf.resourceitem+json
    effective-Of : RangeStartDate=2018-02-01

    Sample Request

    {
      "LegislationCode": "CA"
    }
  4. Verify the details returned in the response. The legislative record is created with EffectiveStartDate of 2018-02-01 and EffectiveEndDate of 4712-12-31.