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 |
---|---|---|---|---|
|
Yes |
No |
Context date or Sysdate |
When a POST operation is performed on a root resource, When a POST operation is performed on a child resource, |
|
Yes |
No |
EOT |
If If user is allowed to end date an object (such as visa), and |
|
No |
NA |
NA |
NA |
|
No |
NA |
NA |
NA |
|
No |
NA |
NA |
NA |
|
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.
- 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" } ] } ] }
- Verify the details returned in the response. The worker record and all its date effective child objects are created with
EffectiveStartDate
same assysdate
.
Example 2
Let's create a worker record by providing the effective-Of
header attribute.
- Perform a POST operation on the
workers
resource using this URL format and providing theRangeStartDate
in theeffective-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" } ] } ] }
- 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.
- 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}
- Obtain the
legislativeInfo
child collection link from the response. - Perform a POST operation on the
legislativeInfo
child collection without providing theeffective-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" }
- Verify the details returned in the response. The legislative record is created with
EffectiveStartDate
same assysdate
.
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.
- Retrieve the worker record by performing a GET operation on the
workers
resource, providing theeffectiveDate
parameter in the URL.GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2018-01-01
- Obtain the
legislativeInfo
child collection link from the response. - Perform a POST operation on the
legislativeInfo
child collection without providing theeffective-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" }
- 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
.
- Retrieve the worker record by performing a GET operation on the
workers
resource, providing theeffectiveDate
parameter in the URL.GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2018-01-01
- Obtain the
legislativeInfo
child collection link from the response. - Perform a POST operation on the
legislativeInfo
child collection by providing theRangeStartDate
in theeffective-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" }
- Verify the details returned in the response. The legislative record is created with
EffectiveStartDate
of 2018-02-01 andEffectiveEndDate
of 4712-12-31.