Create a Contingent Worker

Let's say that James Davidson volunteers at Vision Corporation and requires a security badge to enter the office building. He needs to be created as a contingent worker in the application so that his access can by synced to a schedule.

To create a contingent 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.action+json
effective-Of : RangeStartDate=2019-06-02
{
     "BloodType":"A+",
     "DateOfBirth":"1997-01-01",
"names":[{
       "LastName": "Davidson",
       "FirstName":"James",
       "MiddleNames":"MN",
       "LegislationCode": "US"
        }],
    "emails":[
         {
      "EmailType": "H1",
      "EmailAddress": "test01@example.com",
      "PrimaryFlag":false,
      "FromDate": "{{dateStamp}}"
         },
         {
      "EmailType": "H1",
      "EmailAddress": "test02@example.com", 
      "PrimaryFlag":false,
      "FromDate": "{{dateStamp}}"
         },
         {
      "EmailType": "W1",
      "EmailAddress": "test01@example.com", 
      "PrimaryFlag":true
           }],
     "phones":[{
      "PhoneType": "W1",
      "LegislationCode":"US",
      "PhoneNumber": "3333333",
      "AreaCode":"510",
      "CountryCodeNumber":"1",
      "FromDate": "{{dateStamp}}",
      "PrimaryFlag":false
          },
          {
      "PhoneType": "H1",
      "PhoneNumber": "1111111",
      "AreaCode":"408",
      "CountryCodeNumber":"1",
      "LegislationCode":"US",
      "FromDate": "{{dateStamp}}",
      "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": "{{ssn}}",
     "PrimaryFlag":true
          }],
 "workRelationships":[{
      "LegalEmployerName": "Vision Corporation",
      "WorkerType": "C",
      "EnterpriseSeniorityDate":"{{dateStamp}}",
      "LegalEmployerSeniorityDate":"{{dateStamp}}",
      "PrimaryFlag":true,
   "assignments":[{
        "BusinessUnitName": "Vision Central",
        "ActionCode": "ADD_CWK_WRK",
		"LocationId": "300100006480525"
        }]
    }]
}

Example Response

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

{
    "PersonNumber": "955160008191557",
    "CorrespondenceLanguage": null,
    "BloodType": null,
    "DateOfBirth": null,
    "DateOfDeath": null,
    "CountryOfBirth": null,
    "RegionOfBirth": null,
    "TownOfBirth": null,
    "ApplicantNumber": null,
    "CreatedBy": "HCM_INTEGRATION_SPEC",
    "CreationDate": "2019-06-12T19:01:35+00:00",
    "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
    "LastUpdateDate": "2019-06-12T19:01:36.847+00:00",
    "ethnicities": {
        "items": [
            {
                "EthnicityId": 300100180078823,
                "PrimaryFlag": true,
                "LegislationCode": "US",
                "Ethnicity": "7",
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-12T19:01:35.521+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:36.878+00:00",
                "links": [...]
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "emails": {
        "items": [
            {
                "EmailAddressId": 300100180078813,
                "EmailType": "H1",
                "EmailAddress": "test01@example.com",
                "FromDate": "2019-06-07",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-12T19:01:35.123+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:36.857+00:00",
                "PrimaryFlag": false,
                "links": [...]
            },
            {
                "EmailAddressId": 300100180078814,
                "EmailType": "H1",
                "EmailAddress": "test02@example.com",
                "FromDate": "2019-06-07",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-12T19:01:35.151+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:36.857+00:00",
                "PrimaryFlag": false,
                "links": [...]
            },
            {
                "EmailAddressId": 300100180078815,
                "EmailType": "W1",
                "EmailAddress": "test01@example.com",
                "FromDate": "2019-06-07",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-12T19:01:35.172+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:36.858+00:00",
                "PrimaryFlag": true,
                "links": [...]
            }
        ],
        "count": 3,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "phones": {
        "items": [
            {
                "PhoneId": 300100180078816,
                "PhoneType": "W1",
                "LegislationCode": "US",
                "CountryCodeNumber": "1",
                "AreaCode": "510",
                "PhoneNumber": "333-3333",
                "Extension": null,
                "FromDate": "2019-06-07",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-12T19:01:35.205+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:36.865+00:00",
                "PrimaryFlag": false,
                "links": [...]
            },
            {
                "PhoneId": 300100180078817,
                "PhoneType": "H1",
                "LegislationCode": "US",
                "CountryCodeNumber": "1",
                "AreaCode": "408",
                "PhoneNumber": "111-1111",
                "Extension": null,
                "FromDate": "2019-06-07",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-12T19:01:35.293+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:36.869+00:00",
                "PrimaryFlag": true,
                "links": [...]
            },
            {
                "PhoneId": 300100180078818,
                "PhoneType": "H1",
                "LegislationCode": "US",
                "CountryCodeNumber": "1",
                "AreaCode": "408",
                "PhoneNumber": "222-2222",
                "Extension": null,
                "FromDate": "2019-06-07",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-12T19:01:35.343+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:36.874+00:00",
                "PrimaryFlag": false,
                "links": [...]
            }
        ],
        "count": 3,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "workRelationships": {
        "items": [
            {
                "PeriodOfServiceId": 300100180078825,
                "LegislationCode": "US",
                "LegalEntityId": 40010,
                "LegalEmployerName": null,
                "WorkerType": "C",
                "PrimaryFlag": true,
                "StartDate": "2019-06-07",
                "LegalEmployerSeniorityDate": null,
                "EnterpriseSeniorityDate": null,
                "OnMilitaryServiceFlag": false,
                "WorkerNumber": null,
                "ReadyToConvertFlag": null,
                "TerminationDate": null,
                "NotificationDate": null,
                "LastWorkingDate": null,
                "RevokeUserAccess": null,
                "RecommendedForRehire": "ORA_NS",
                "RecommendationReason": null,
                "RecommendationAuthorizedByPersonId": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-12T19:01:35.644+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:38.100+00:00",
                "assignments": {
                    "items": [
                        {
                            "AssignmentId": 300100180078827,
                            "AssignmentNumber": "N955160008191557",
                            "AssignmentName": "N955160008191557",
                            "ActionCode": "ADD_CWK_WRK",
                            "ReasonCode": null,
                            "EffectiveStartDate": "2019-06-07",
                            "EffectiveEndDate": "4712-12-31",
                            "EffectiveSequence": 1,
                            "EffectiveLatestChange": "Y",
                            "BusinessUnitId": 300100024264603,
                            "BusinessUnitName": "Vision Central",
                            "AssignmentType": "N",
                            "AssignmentStatusTypeId": 100010026278190,
                            "AssignmentStatusTypeCode": "ACTIVE_PROCESS",
                            "AssignmentStatusType": "ACTIVE",
                            "SystemPersonType": "NONW",
                            "UserPersonTypeId": 9001,
                            "UserPersonType": "Non Worker",
                            "ProposedUserPersonTypeId": null,
                            "ProposedUserPersonType": null,
                            "ProjectedStartDate": null,
                            "ProjectedEndDate": null,
                            "PrimaryFlag": true,
                            "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": 300100006480525,
                            "LocationCode": "PMBUTTECA",
                            "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-12T19:01:35.802+00:00",
                            "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                            "LastUpdateDate": "2019-06-12T19:01:38.183+00:00",
                            "links": [...]
                        }
                    ],
                    "count": 1,
                    "hasMore": false,
                    "limit": 25,
                    "offset": 0,
                    "links": [...]
                },
                "links": [...]
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "names": {
        "items": [
            {
                "PersonNameId": 300100180078811,
                "EffectiveStartDate": "2019-06-07",
                "EffectiveEndDate": "4712-12-31",
                "LegislationCode": "US",
                "LastName": "Davidson",
                "FirstName": "James",
                "Title": null,
                "PreNameAdjunct": null,
                "Suffix": null,
                "MiddleNames": "MN",
                "Honors": null,
                "KnownAs": null,
                "PreviousLastName": null,
                "DisplayName": "James Davidson",
                "OrderName": "Davidson James",
                "ListName": "Davidson, James",
                "FullName": "Davidson, James MN",
                "NameLanguage": "US",
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-12T19:01:35.071+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:36.854+00:00",
                "LocalPersonNameId": 300100180078812,
                "LocalEffectiveStartDate": "2019-06-07",
                "LocalEffectiveEndDate": "4712-12-31",
                "LocalLegislationCode": "US",
                "LocalLastName": "Davidson",
                "LocalFirstName": "James",
                "LocalTitle": null,
                "LocalPreNameAdjunct": null,
                "LocalSuffix": null,
                "LocalMiddleNames": "MN",
                "LocalHonors": null,
                "LocalKnownAs": null,
                "LocalPreviousLastName": null,
                "LocalDisplayName": "James Davidson",
                "LocalOrderName": "Davidson James",
                "LocalListName": "Davidson, James",
                "LocalFullName": "Davidson James",
                "LocalNameLanguage": "US",
                "LocalCreatedBy": "HCM_INTEGRATION_SPEC",
                "LocalCreationDate": "2019-06-12T19:01:35.071+00:00",
                "LocalLastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LocalLastUpdateDate": "2019-06-12T19:01:36.856+00:00",
                "links": [...]
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "nationalIdentifiers": {
        "items": [
            {
                "NationalIdentifierId": 300100180078824,
                "LegislationCode": "US",
                "NationalIdentifierType": "SSN",
                "NationalIdentifierNumber": "031-02-0932",
                "IssueDate": null,
                "ExpirationDate": null,
                "PlaceOfIssue": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-12T19:01:35.574+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:36.881+00:00",
                "PrimaryFlag": true,
                "links": [...]
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "addresses": {
        "items": [
            {
                "AddressId": 300100180078819,
                "EffectiveStartDate": "2019-06-07",
                "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-12T19:01:35.399+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:36.913+00:00",
                "PersonAddrUsageId": 300100180078820,
                "AddressType": "HOME",
                "PrimaryFlag": true,
                "links": [...]
            },
            {
                "AddressId": 300100180078821,
                "EffectiveStartDate": "2019-06-07",
                "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-12T19:01:35.465+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T19:01:37.123+00:00",
                "PersonAddrUsageId": 300100180078822,
                "AddressType": "MAIL",
                "PrimaryFlag": false,
                "links": [...]
            }
        ],
        "count": 2,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "links": [...]
}