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
workersresource using this URL format.POST /hcmRestApi/resources/11.13.18.05/workersHeader
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+jsonSample 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
EffectiveStartDatesame assysdate.
Example 2
Let's create a worker record by providing
the effective-Of header
attribute.
- Perform a POST operation on the
workersresource using this URL format and providing theRangeStartDatein theeffective-Ofheader attribute.POST /hcmRestApi/resources/11.13.18.05/workersHeader
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+json effective-Of : RangeStartDate=2017-01-01Sample 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
EffectiveStartDateof 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
workersresource using this URL format.GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id} - Obtain the
legislativeInfochild collection link from the response. - Perform a POST operation on the
legislativeInfochild collection without providing theeffective-Ofheader attribute.POST /hcmRestApi/resources/11.13.18.05/workers/{PersonId}/child/legislativeInfoHeader
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+jsonSample Request
{ "LegislationCode": "CA" } - Verify the details returned in the
response. The legislative record is created with
EffectiveStartDatesame 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
workersresource, providing theeffectiveDateparameter in the URL.GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2018-01-01 - Obtain the
legislativeInfochild collection link from the response. - Perform a POST operation on the
legislativeInfochild collection without providing theeffective-Ofheader attribute.POST /hcmRestApi/resources/11.13.18.05/workers/{PersonId}/child/legislativeInfoHeader
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+jsonSample Request
{ "LegislationCode": "CA" } - Verify the details returned in the
response. The legislative record is created with
EffectiveStartDateof 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
workersresource, providing theeffectiveDateparameter in the URL.GET /hcmRestApi/resources/11.13.18.05/workers?q=PersonId={id}&effectiveDate=2018-01-01 - Obtain the
legislativeInfochild collection link from the response. - Perform a POST operation on the
legislativeInfochild collection by providing theRangeStartDatein theeffective-Ofheader attribute.POST /hcmRestApi/resources/11.13.18.05/workers/{PersonId}/child/legislativeInfoHeader
REST-Framework-Version : 4 Content-Type : application/vnd.oracle.adf.resourceitem+json effective-Of : RangeStartDate=2018-02-01Sample Request
{ "LegislationCode": "CA" } - Verify the details returned in the
response. The legislative record is created with
EffectiveStartDateof 2018-02-01 andEffectiveEndDateof 4712-12-31.