Create a Pending Worker

Let's say that Alex Robinson has just signed a contract to work for your company. Alex isn't starting immediately, so he's being created as a pending worker in the application until his on-boarding is complete and he's ready to be converted to an employee.

To create a pending worker:

  1. Perform a POST operation on the workers resource by providing the worker details in the request body.
  2. Verify the details returned in the response.

Example URL

Use this resource URL format.

POST

/hcmRestApi/resources/11.13.18.05/workers

Example Request

Here's an example of the request body in JSON format.

Provide the headers.

REST-Framework-Version : 4
Content-Type : application/vnd.oracle.adf.resourceitem+json
effective-Of : RangeStartDate=2019-06-02
{
     "BloodType":"A+",
     "DateOfBirth":"1999-01-01",
"names":[{
       "LastName": "Robinson",
       "FirstName":"Alex",
       "MiddleNames":"MN",
       "LegislationCode": "US"
        }],
    "emails":[
         {
      "EmailType": "H1",
      "EmailAddress": "test01@example.com",
      "PrimaryFlag":false,
      "FromDate": "2019-06-02"
         },
         {
      "EmailType": "H1",
      "EmailAddress": "test02@example.com", 
      "PrimaryFlag":false,
      "FromDate": "2019-06-02",
      "PrimaryFlag":true
         }],
     "phones":[{
      "PhoneType": "W1",
      "LegislationCode":"US",
      "PhoneNumber": "3333333",
      "AreaCode":"510",
      "CountryCodeNumber":"1",
      "FromDate": "2019-06-02",
      "PrimaryFlag":false
          },
          {
      "PhoneType": "H1",
      "PhoneNumber": "1111111",
      "AreaCode":"408",
      "CountryCodeNumber":"1",
      "LegislationCode":"US",
      "FromDate": "2019-06-02",
      "PrimaryFlag":true
          },
          {
      "PhoneType": "H1",
      "PhoneNumber": "2222222",
      "AreaCode":"408",
      "CountryCodeNumber":"1",
      "LegislationCode":"US",
      "PrimaryFlag":false
          }],
    "addresses":[{
        "AddressType":"HOME",
        "AddressLine1":"101 Main Street",
        "TownOrCity":"Suwanee",
        "Region1":"Gwinnett",
        "Region2":"GA",
        "PostalCode":"30024",
        "Country":"US",
        "PrimaryFlag":true
          },
          {
        "AddressType":"MAIL",
        "AddressLine1":"100 Bell Drive",
        "TownOrCity":"FREMONT",
        "Region1":"Alameda",
        "Region2":"CA",
        "Region3":"Bay Area",
        "PostalCode":"94539",
        "Country":"US",
        "PrimaryFlag":false
          }],
        "ethnicities": [{
     "LegislationCode": "US",
     "Ethnicity": "7",
     "PrimaryFlag":true
         }],
    "nationalIdentifiers":[{
     "LegislationCode": "US",
     "NationalIdentifierType": "SSN",
     "NationalIdentifierNumber": "111-52-2932",
     "PrimaryFlag":true
          }],
 "workRelationships":[{
      "LegalEmployerName": "Vision Corporation",
      "WorkerType": "P",
      "EnterpriseSeniorityDate":"2019-06-02",
      "LegalEmployerSeniorityDate":"2019-06-02",
      "PrimaryFlag":false,
   "assignments":[{
        "BusinessUnitName": "Vision Central",
		"LocationCode": "Pleasanton - CA",
		"ActionCode": "ADD_PEN_WKR",
        "ReasonCode":"PENDWKR",
        "ProposedUserPersonType": "Employee",
        "ProjectedStartDate": "2019-06-02",
        "UserPersonType": "Pending Worker",
        "AssignmentName":"Accounting",
        "AssignmentNumber":"E1559922840",
		"managers":[{
            "ManagerAssignmentNumber": "E955160008191540",
            "ManagerType": "LINE_MANAGER"
            }],
		  "workMeasures":[{
         "Value": 1.5,
         "Unit": "FTE"
              },
              {
         "Value": 1,
         "Unit": "HEAD"
              }]
        }]
    }]
}

Example Response

Here's an example of the response body in JSON format.

{
    "PersonNumber": "955160008191544",
    "CorrespondenceLanguage": null,
    "BloodType": null,
    "DateOfBirth": null,
    "DateOfDeath": null,
    "CountryOfBirth": null,
    "RegionOfBirth": null,
    "TownOfBirth": null,
    "ApplicantNumber": null,
    "CreatedBy": "HCM_INTEGRATION_SPEC",
    "CreationDate": "2019-06-07T15:52:00+00:00",
    "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
    "LastUpdateDate": "2019-06-07T15:52:02.042+00:00",
    "ethnicities": {
        "items": [
            {
                "EthnicityId": 300100180005745,
                "PrimaryFlag": true,
                "LegislationCode": "US",
                "Ethnicity": "7",
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-07T15:52:00.435+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-07T15:52:02.072+00:00",
                "links": [...]
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "emails": {
        "items": [
            {
                "EmailAddressId": 300100180005736,
                "EmailType": "H1",
                "EmailAddress": "test01@example.com",
                "FromDate": "2019-06-02",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-07T15:52:00.115+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-07T15:52:02.051+00:00",
                "PrimaryFlag": false,
                "links": [...]
            },
            {
                "EmailAddressId": 300100180005737,
                "EmailType": "H1",
                "EmailAddress": "test02@example.com",
                "FromDate": "2019-06-02",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-07T15:52:00.142+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-07T15:52:02.052+00:00",
                "PrimaryFlag": true,
                "links": [...]
            }
        ],
        "count": 2,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "phones": {
        "items": [
            {
                "PhoneId": 300100180005738,
                "PhoneType": "W1",
                "LegislationCode": "US",
                "CountryCodeNumber": "1",
                "AreaCode": "510",
                "PhoneNumber": "333-3333",
                "Extension": null,
                "FromDate": "2019-06-02",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-07T15:52:00.171+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-07T15:52:02.057+00:00",
                "PrimaryFlag": false,
                "links": [...]
            },
            {
                "PhoneId": 300100180005739,
                "PhoneType": "H1",
                "LegislationCode": "US",
                "CountryCodeNumber": "1",
                "AreaCode": "408",
                "PhoneNumber": "111-1111",
                "Extension": null,
                "FromDate": "2019-06-02",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-07T15:52:00.246+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-07T15:52:02.062+00:00",
                "PrimaryFlag": true,
                "links": [...]
            },
            {
                "PhoneId": 300100180005740,
                "PhoneType": "H1",
                "LegislationCode": "US",
                "CountryCodeNumber": "1",
                "AreaCode": "408",
                "PhoneNumber": "222-2222",
                "Extension": null,
                "FromDate": "2019-06-02",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-07T15:52:00.287+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-07T15:52:02.067+00:00",
                "PrimaryFlag": false,
                "links": [...]
            }
        ],
        "count": 3,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "workRelationships": {
        "items": [
            {
                "PeriodOfServiceId": 300100180005747,
                "LegislationCode": "US",
                "LegalEntityId": 40010,
                "LegalEmployerName": null,
                "WorkerType": "P",
                "PrimaryFlag": false,
                "StartDate": "2019-06-02",
                "LegalEmployerSeniorityDate": null,
                "EnterpriseSeniorityDate": null,
                "OnMilitaryServiceFlag": false,
                "WorkerNumber": null,
                "ReadyToConvertFlag": false,
                "TerminationDate": null,
                "NotificationDate": null,
                "LastWorkingDate": null,
                "RevokeUserAccess": null,
                "RecommendedForRehire": "ORA_NS",
                "RecommendationReason": null,
                "RecommendationAuthorizedByPersonId": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-07T15:52:00.552+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-07T15:52:03.276+00:00",
                "assignments": {
                    "items": [
                        {
                            "AssignmentId": 300100180005749,
                            "AssignmentNumber": "E1559922749",
                            "AssignmentName": "Accounting",
                            "ActionCode": "ADD_PEN_WKR",
                            "ReasonCode": "PENDWKR",
                            "EffectiveStartDate": "2019-06-02",
                            "EffectiveEndDate": "4712-12-31",
                            "EffectiveSequence": 1,
                            "EffectiveLatestChange": "Y",
                            "BusinessUnitId": 300100024264603,
                            "BusinessUnitName": "Vision Central",
                            "AssignmentType": "P",
                            "AssignmentStatusTypeId": 100010026278190,
                            "AssignmentStatusTypeCode": "ACTIVE_PROCESS",
                            "AssignmentStatusType": "ACTIVE",
                            "SystemPersonType": "PWK",
                            "UserPersonTypeId": 100010024214833,
                            "UserPersonType": "Pending Worker",
                            "ProposedUserPersonTypeId": "13",
                            "ProposedUserPersonType": "Employee",
                            "ProjectedStartDate": "2019-06-02",
                            "ProjectedEndDate": null,
                            "PrimaryFlag": false,
                            "PrimaryAssignmentFlag": true,
                            "PositionId": null,
                            "PositionCode": null,
                            "SynchronizeFromPositionFlag": true,
                            "JobId": null,
                            "JobCode": null,
                            "GradeId": null,
                            "GradeCode": null,
                            "GradeLadderId": null,
                            "GradeLadderName": null,
                            "GradeStepEligibilityFlag": true,
                            "GradeCeilingStepId": null,
                            "GradeCeilingStep": null,
                            "DepartmentId": null,
                            "DepartmentName": null,
                            "ReportingEstablishmentId": null,
                            "ReportingEstablishmentName": null,
                            "LocationId": 100000000000010,
                            "LocationCode": "Pleasanton - CA",
                            "WorkAtHomeFlag": false,
                            "AssignmentCategory": null,
                            "WorkerCategory": null,
                            "PermanentTemporary": null,
                            "FullPartTime": null,
                            "ManagerFlag": false,
                            "HourlySalariedCode": null,
                            "NormalHours": null,
                            "Frequency": null,
                            "StartTime": null,
                            "EndTime": null,
                            "SeniorityBasis": "ORA_PER_SNDT_DAYS",
                            "ProbationPeriod": null,
                            "ProbationPeriodUnit": null,
                            "ProbationEndDate": null,
                            "NoticePeriod": null,
                            "NoticePeriodUOM": null,
                            "WorkTaxAddressId": null,
                            "ExpenseCheckSendToAddress": null,
                            "RetirementAge": null,
                            "RetirementDate": null,
                            "LabourUnionMemberFlag": null,
                            "UnionId": null,
                            "UnionName": null,
                            "BargainingUnitCode": null,
                            "CollectiveAgreementId": null,
                            "CollectiveAgreementName": null,
                            "InternalBuilding": null,
                            "InternalFloor": null,
                            "InternalOfficeNumber": null,
                            "InternalMailstop": null,
                            "DefaultExpenseAccount": null,
                            "PeopleGroup": null,
                            "CreatedBy": "HCM_INTEGRATION_SPEC",
                            "CreationDate": "2019-06-07T15:52:00.684+00:00",
                            "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                            "LastUpdateDate": "2019-06-07T15:52:03.361+00:00",
                            "managers": {
                                "items": [
                                    {
                                        "AssignmentSupervisorId": 598506,
                                        "EffectiveStartDate": "2019-06-02",
                                        "EffectiveEndDate": "4712-12-31",
                                        "ManagerAssignmentId": 300100180000401,
                                        "ManagerAssignmentNumber": "E955160008191540",
                                        "ManagerType": "LINE_MANAGER",
                                        "ActionCode": "ADD_PEN_WKR",
                                        "ReasonCode": "PENDWKR",
                                        "CreatedBy": "HCM_INTEGRATION_SPEC",
                                        "CreationDate": "2019-06-07T15:52:01.041+00:00",
                                        "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                                        "LastUpdateDate": "2019-06-07T15:52:03.407+00:00",
                                        "links": [...]
                                    }
                                ],
                                "count": 1,
                                "hasMore": false,
                                "limit": 25,
                                "offset": 0,
                                "links": [...]
                            },
                            "workMeasures": {
                                "items": [
                                    {
                                        "AssignWorkMeasureId": 300100180005751,
                                        "EffectiveStartDate": "2019-06-02",
                                        "EffectiveEndDate": "4712-12-31",
                                        "Value": 1.5,
                                        "Unit": "FTE",
                                        "ActionCode": "ADD_PEN_WKR",
                                        "ReasonCode": "PENDWKR",
                                        "CreatedBy": "HCM_INTEGRATION_SPEC",
                                        "CreationDate": "2019-06-07T15:52:01.122+00:00",
                                        "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                                        "LastUpdateDate": "2019-06-07T15:52:03.446+00:00",
                                        "links": [...]
                                    },
                                    {
                                        "AssignWorkMeasureId": 300100180005752,
                                        "EffectiveStartDate": "2019-06-02",
                                        "EffectiveEndDate": "4712-12-31",
                                        "Value": 1,
                                        "Unit": "HEAD",
                                        "ActionCode": "ADD_PEN_WKR",
                                        "ReasonCode": "PENDWKR",
                                        "CreatedBy": "HCM_INTEGRATION_SPEC",
                                        "CreationDate": "2019-06-07T15:52:01.153+00:00",
                                        "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                                        "LastUpdateDate": "2019-06-07T15:52:03.493+00:00",
                                        "links": [...]
                                    }
                                ],
                                "count": 2,
                                "hasMore": false,
                                "limit": 25,
                                "offset": 0,
                                "links": [...]
                            },
                            "links": [...]
                        }
                    ],
                    "count": 1,
                    "hasMore": false,
                    "limit": 25,
                    "offset": 0,
                    "links": [...]
                },
                "links": [...]
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "names": {
        "items": [
            {
                "PersonNameId": 300100180005734,
                "EffectiveStartDate": "2019-06-02",
                "EffectiveEndDate": "4712-12-31",
                "LegislationCode": "US",
                "LastName": "Robinson",
                "FirstName": "Alex",
                "Title": null,
                "PreNameAdjunct": null,
                "Suffix": null,
                "MiddleNames": "MN",
                "Honors": null,
                "KnownAs": null,
                "PreviousLastName": null,
                "DisplayName": "Alex Robinson",
                "OrderName": "Robinson Alex",
                "ListName": "Robinson, Alex",
                "FullName": "Robinson, Alex MN",
                "NameLanguage": "US",
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-07T15:52:00.069+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-07T15:52:02.049+00:00",
                "LocalPersonNameId": 300100180005735,
                "LocalEffectiveStartDate": "2019-06-02",
                "LocalEffectiveEndDate": "4712-12-31",
                "LocalLegislationCode": "US",
                "LocalLastName": "Robinson",
                "LocalFirstName": "Alex",
                "LocalTitle": null,
                "LocalPreNameAdjunct": null,
                "LocalSuffix": null,
                "LocalMiddleNames": "MN",
                "LocalHonors": null,
                "LocalKnownAs": null,
                "LocalPreviousLastName": null,
                "LocalDisplayName": "Alex Robinson",
                "LocalOrderName": "Robinson Alex",
                "LocalListName": "Robinson, Alex",
                "LocalFullName": "Robinson Alex",
                "LocalNameLanguage": "US",
                "LocalCreatedBy": "HCM_INTEGRATION_SPEC",
                "LocalCreationDate": "2019-06-07T15:52:00.069+00:00",
                "LocalLastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LocalLastUpdateDate": "2019-06-07T15:52:02.050+00:00",
                "links": [...]
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "nationalIdentifiers": {
        "items": [
            {
                "NationalIdentifierId": 300100180005746,
                "LegislationCode": "US",
                "NationalIdentifierType": "SSN",
                "NationalIdentifierNumber": "111-52-2932",
                "IssueDate": null,
                "ExpirationDate": null,
                "PlaceOfIssue": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-07T15:52:00.495+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-07T15:52:02.074+00:00",
                "PrimaryFlag": true,
                "links": [...],
        "count": 1,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "addresses": {
        "items": [
            {
                "AddressId": 300100180005741,
                "EffectiveStartDate": "2019-06-02",
                "EffectiveEndDate": "4712-12-31",
                "AddressLine1": "101 Main Street",
                "AddressLine2": null,
                "AddressLine3": null,
                "AddressLine4": null,
                "TownOrCity": "Suwanee",
                "Region1": "Gwinnett",
                "Region2": "GA",
                "Region3": null,
                "Country": "US",
                "PostalCode": "30024",
                "LongPostalCode": null,
                "AddlAddressAttribute1": null,
                "AddlAddressAttribute2": null,
                "AddlAddressAttribute3": null,
                "AddlAddressAttribute4": null,
                "AddlAddressAttribute5": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-07T15:52:00.336+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-07T15:52:02.105+00:00",
                "PersonAddrUsageId": 300100180005742,
                "AddressType": "HOME",
                "PrimaryFlag": true,
                "links": [...]
            },
            {
                "AddressId": 300100180005743,
                "EffectiveStartDate": "2019-06-02",
                "EffectiveEndDate": "4712-12-31",
                "AddressLine1": "100 Bell Drive",
                "AddressLine2": null,
                "AddressLine3": null,
                "AddressLine4": null,
                "TownOrCity": "FREMONT",
                "Region1": "Alameda",
                "Region2": "CA",
                "Region3": "Bay Area",
                "Country": "US",
                "PostalCode": "94539",
                "LongPostalCode": null,
                "AddlAddressAttribute1": null,
                "AddlAddressAttribute2": null,
                "AddlAddressAttribute3": null,
                "AddlAddressAttribute4": null,
                "AddlAddressAttribute5": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-07T15:52:00.395+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-07T15:52:02.337+00:00",
                "PersonAddrUsageId": 300100180005744,
                "AddressType": "MAIL",
                "PrimaryFlag": false,
                "links": [...]
            }
        ],
        "count": 2,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "links": [...]
}

Correct the Proposed Start Date

Alex is able to start earlier than expected so you need to correct his start date.

To correct the proposed start date:

  1. Retrieve (GET) the work relationship details and obtain the link to changeStartDate.
  2. Perform a POST operation on this URL by providing the new start date in the request body.

Example URL

Use this resource URL format.

POST

/hcmRestApi/resources/11.13.18.05/workers/{Id}/child/workRelationships/{Id)/action/changeStartDate

Example Request

Here's an example of the request body in JSON format.

Provide the headers.

REST-Framework-Version : 4
Content-Type : application/vnd.oracle.adf.action+json
{
"startDate":"2019-06-01"
}

Example Response

Here's an example of the response body in JSON format.

{
"result": "true"
}

Set the Ready to Convert Flag

Alex has completed his on-boarding tasks, so we can convert him to an employee. Set the ReadyToConvertFlag attribute to true. Alex will be converted to an employee when the Run Convert Pending Workers Automatically Process scheduled job is run.

To set the ReadyToConvertFlag attribute:

  1. Retrieve (GET) the work relationship details and obtain the work relationship item link.
  2. Perform a PATCH operation on this URL by providing the ReadyToConvertFlag attribute value in the request body.

Example URL

Use this resource URL format.

PATCH

/hcmRestApi/resources/11.13.18.05/workers/{Id}/child/workRelationships/300100180034508

Example Request

Here's an example of the request body in JSON format.

Provide the headers.

Content-Type : application/vnd.oracle.adf.resourceitem+json
REST-Framework-Version : 4
{
"ReadyToConvertFlag":true
}

Example Response

Here's an example of the response body in JSON format.

{
  "PeriodOfServiceId": 300100180005747,
	"LegislationCode": "US",
	"LegalEntityId": 40010,
	"LegalEmployerName": null,
	"WorkerType": "P",
	"PrimaryFlag": false,
	"StartDate": "2019-06-02",
	"LegalEmployerSeniorityDate": null,
	"EnterpriseSeniorityDate": null,
	"OnMilitaryServiceFlag": false,
	"WorkerNumber": null,
	"ReadyToConvertFlag": true,
	"TerminationDate": null,
	"NotificationDate": null,
	"LastWorkingDate": null,
	"RevokeUserAccess": null,
	"RecommendedForRehire": "ORA_NS",
	"RecommendationReason": null,
	"RecommendationAuthorizedByPersonId": null,
    "CreatedBy": "HCM_INTEGRATION_SPEC",
    "CreationDate": "2019-06-10T16:02:00.608+00:00",
    "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
    "LastUpdateDate": "2019-06-10T16:03:57.101+00:00",
    "links": [
        {... ]
}