Create an Employee

Let's say that Daniel Rogers is being hired at Vision Corporation as an employee. His person and assignment details need to be created in the application.

To create an employee:

  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": "Martineau",
       "FirstName":"Alicia",
       "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": "E",
      "EnterpriseSeniorityDate":"{{dateStamp}}",
      "LegalEmployerSeniorityDate":"{{dateStamp}}",
      "PrimaryFlag":true,
   "assignments":[{
        "BusinessUnitName": "Vision Central",
        "ActionCode": "{{action_code}}",
		"LocationId": "300100006480525",
		"assignmentsDFF":[{
         "asgNum": 11,
         "asgChar": "Y"
          }]
        }]
    }]
}

Example Response

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

{
    "PersonNumber": "955160008191566",
    "CorrespondenceLanguage": null,
    "BloodType": null,
    "DateOfBirth": null,
    "DateOfDeath": null,
    "CountryOfBirth": null,
    "RegionOfBirth": null,
    "TownOfBirth": null,
    "ApplicantNumber": null,
    "CreatedBy": "HCM_INTEGRATION_SPEC",
    "CreationDate": "2019-06-20T15:34:55+00:00",
    "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
    "LastUpdateDate": "2019-06-20T15:35:32.129+00:00",
    "ethnicities": {
        "items": [
            {
                "EthnicityId": 300100180235417,
                "PrimaryFlag": true,
                "LegislationCode": "US",
                "Ethnicity": "7",
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-20T15:35:01.604+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:32.251+00:00",
                "links": [...]
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "emails": {
        "items": [
            {
                "EmailAddressId": 300100180235407,
                "EmailType": "H1",
                "EmailAddress": "test01@example.com",
                "FromDate": "2019-06-15",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-20T15:34:57.693+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:32.218+00:00",
                "PrimaryFlag": false,
                "links": [...]
            },
            {
                "EmailAddressId": 300100180235408,
                "EmailType": "H1",
                "EmailAddress": "test02@example.com",
                "FromDate": "2019-06-15",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-20T15:34:58.267+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:32.219+00:00",
                "PrimaryFlag": false,
                "links": [...]
            },
            {
                "EmailAddressId": 300100180235409,
                "EmailType": "W1",
                "EmailAddress": "test01@example.com",
                "FromDate": "2019-06-15",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-20T15:34:58.306+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:32.220+00:00",
                "PrimaryFlag": true,
                "links": [...]
            }
        ],
        "count": 3,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "phones": {
        "items": [
            {
                "PhoneId": 300100180235410,
                "PhoneType": "W1",
                "LegislationCode": "US",
                "CountryCodeNumber": "1",
                "AreaCode": "510",
                "PhoneNumber": "333-3333",
                "Extension": null,
                "FromDate": "2019-06-15",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-20T15:34:58.594+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:32.232+00:00",
                "PrimaryFlag": false,
                "links": [...]
            },
            {
                "PhoneId": 300100180235411,
                "PhoneType": "H1",
                "LegislationCode": "US",
                "CountryCodeNumber": "1",
                "AreaCode": "408",
                "PhoneNumber": "111-1111",
                "Extension": null,
                "FromDate": "2019-06-15",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-20T15:34:59.641+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:32.238+00:00",
                "PrimaryFlag": true,
                "links": [...]
            },
            {
                "PhoneId": 300100180235412,
                "PhoneType": "H1",
                "LegislationCode": "US",
                "CountryCodeNumber": "1",
                "AreaCode": "408",
                "PhoneNumber": "222-2222",
                "Extension": null,
                "FromDate": "2019-06-15",
                "ToDate": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-20T15:34:59.767+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:32.245+00:00",
                "PrimaryFlag": false,
                "links": [...]
            }
        ],
        "count": 3,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "workRelationships": {
        "items": [
            {
                "PeriodOfServiceId": 300100180235419,
                "LegislationCode": "US",
                "LegalEntityId": 40010,
                "LegalEmployerName": null,
                "WorkerType": "E",
                "PrimaryFlag": true,
                "StartDate": "2019-06-15",
                "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-20T15:35:04.444+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:47.129+00:00",
                "assignments": {
                    "items": [
                        {
                            "AssignmentId": 300100180235425,
                            "AssignmentNumber": "E955160008191566",
                            "AssignmentName": "E955160008191566",
                            "ActionCode": "HIRE_ADD_WORK_RELATION",
                            "ReasonCode": null,
                            "EffectiveStartDate": "2019-06-15",
                            "EffectiveEndDate": "4712-12-31",
                            "EffectiveSequence": 1,
                            "EffectiveLatestChange": "Y",
                            "BusinessUnitId": 300100024264603,
                            "BusinessUnitName": "Vision Central",
                            "AssignmentType": "E",
                            "AssignmentStatusTypeId": 100010026278190,
                            "AssignmentStatusTypeCode": "ACTIVE_PROCESS",
                            "AssignmentStatusType": "ACTIVE",
                            "SystemPersonType": "EMP",
                            "UserPersonTypeId": 13,
                            "UserPersonType": "Employee",
                            "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-20T15:35:08.706+00:00",
                            "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                            "LastUpdateDate": "2019-06-20T15:35:48.942+00:00",
                            "assignmentsDFF": {
                                "items": [
                                    {
                                        "AssignmentId": 300100180235425,
                                        "EffectiveStartDate": "2019-06-15",
                                        "EffectiveEndDate": "4712-12-31",
                                        "EffectiveSequence": 1,
                                        "EffectiveLatestChange": "Y",
                                        "AssignmentType": "E",
                                        "_asg_global": null,
                                        "FBLAG": null,
                                        "hdlG": null,
                                        "fblg1": null,
                                        "fblg2": null,
                                        "fblg3": null,
                                        "fblg4": null,
                                        "fblg5": null,
                                        "synchGlbNum": null,
                                        "synchGlbChar": null,
                                        "asgNum": 11,
                                        "asgChar": "Y",
                                        "__FLEX_Context": null,
                                        "__FLEX_Context_DisplayValue": null,
                                        "links": [...]
                                    }
                                ],
                                "count": 1,
                                "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": 300100180235405,
                "EffectiveStartDate": "2019-06-15",
                "EffectiveEndDate": "4712-12-31",
                "LegislationCode": "US",
                "LastName": "Rogers",
                "FirstName": "Daniel",
                "Title": null,
                "PreNameAdjunct": null,
                "Suffix": null,
                "MiddleNames": "MN",
                "Honors": null,
                "KnownAs": null,
                "PreviousLastName": null,
                "DisplayName": "Daniel Rogers",
                "OrderName": "Rogers Daniel",
                "ListName": "Rogers, Daniel",
                "FullName": "Rogers, Daniel MN",
                "NameLanguage": "US",
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-20T15:34:56.967+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:32.210+00:00",
                "LocalPersonNameId": 300100180235406,
                "LocalEffectiveStartDate": "2019-06-15",
                "LocalEffectiveEndDate": "4712-12-31",
                "LocalLegislationCode": "US",
                "LocalLastName": "Rogers",
                "LocalFirstName": "Daniel",
                "LocalTitle": null,
                "LocalPreNameAdjunct": null,
                "LocalSuffix": null,
                "LocalMiddleNames": "MN",
                "LocalHonors": null,
                "LocalKnownAs": null,
                "LocalPreviousLastName": null,
                "LocalDisplayName": "Daniel Rogers",
                "LocalOrderName": "Rogers Daniel",
                "LocalListName": "Rogers, Daniel",
                "LocalFullName": "Rogers Daniel",
                "LocalNameLanguage": "US",
                "LocalCreatedBy": "HCM_INTEGRATION_SPEC",
                "LocalCreationDate": "2019-06-20T15:34:56.967+00:00",
                "LocalLastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LocalLastUpdateDate": "2019-06-20T15:35:32.213+00:00",
                "links": [...]
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "nationalIdentifiers": {
        "items": [
            {
                "NationalIdentifierId": 300100180235418,
                "LegislationCode": "US",
                "NationalIdentifierType": "SSN",
                "NationalIdentifierNumber": "111-34-1432",
                "IssueDate": null,
                "ExpirationDate": null,
                "PlaceOfIssue": null,
                "CreatedBy": "HCM_INTEGRATION_SPEC",
                "CreationDate": "2019-06-20T15:35:02.358+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:32.258+00:00",
                "PrimaryFlag": true,
                "links": [...]
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "addresses": {
        "items": [
            {
                "AddressId": 300100180235413,
                "EffectiveStartDate": "2019-06-15",
                "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-20T15:35:00.002+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:33.319+00:00",
                "PersonAddrUsageId": 300100180235414,
                "AddressType": "HOME",
                "PrimaryFlag": true,
                "links": [...]
            },
            {
                "AddressId": 300100180235415,
                "EffectiveStartDate": "2019-06-15",
                "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-20T15:35:01.394+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-20T15:35:37.127+00:00",
                "PersonAddrUsageId": 300100180235416,
                "AddressType": "MAIL",
                "PrimaryFlag": false,
                "links": [...]
            }
        ],
        "count": 2,
        "hasMore": false,
        "limit": 25,
        "offset": 0,
        "links": [...]
    },
    "links": [...]
}