Add a Work Relationship

Let's say that Jasmine Astor separated from the company four years back and has been re-hired recently. A new work relationship needs to be created for Jasmine in the application.

To add a new work relationship for a worker:

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

Example URL

Use this resource URL format.

POST

/hcmRestApi/resources/11.13.18.05/workers/{workersUniqID}/child/workRelationships

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
effective-Of : RangeStartDate=2019-06-11
{
"LegalEmployerName": "Vision Corporation",
      "LegalEmployerName": "Vision Corporation",
      "WorkerType": "E",
      "EnterpriseSeniorityDate":"2019-06-12",
      "LegalEmployerSeniorityDate":"2019-06-12",
      "PrimaryFlag":true,
   "assignments":[{
        "BusinessUnitName": "Vision Central",
		"LocationCode": "Pleasanton - CA",
        "ActionCode": "HIRE_ADD_WORK_RELATION",
        "AssignmentName":"Accounting",
        "AssignmentNumber":"E1560356024",
		"managers":[{
            "ManagerAssignmentNumber": "E955160008191552",
            "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.

{
    "PeriodOfServiceId": 300100180069629,
    "LegislationCode": "US",
    "LegalEntityId": 40010,
    "LegalEmployerName": null,
    "WorkerType": "E",
    "PrimaryFlag": true,
    "StartDate": "2019-06-12",
    "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-12T16:11:13+00:00",
    "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
    "LastUpdateDate": "2019-06-12T16:11:15.573+00:00",
    "assignments": {
        "items": [
            {
                "AssignmentId": 300100180069635,
                "AssignmentNumber": "E1560355908",
                "AssignmentName": "Accounting",
                "ActionCode": "HIRE_ADD_WORK_RELATION",
                "ReasonCode": null,
                "EffectiveStartDate": "2019-06-12",
                "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": 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-12T16:11:13.111+00:00",
                "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                "LastUpdateDate": "2019-06-12T16:11:15.805+00:00",
                "managers": {
                    "items": [
                        {
                            "AssignmentSupervisorId": 600519,
                            "EffectiveStartDate": "2019-06-12",
                            "EffectiveEndDate": "4712-12-31",
                            "ManagerAssignmentId": 300100180052435,
                            "ManagerAssignmentNumber": "E955160008191552",
                            "ManagerType": "LINE_MANAGER",
                            "ActionCode": "HIRE_ADD_WORK_RELATION",
                            "ReasonCode": null,
                            "CreatedBy": "HCM_INTEGRATION_SPEC",
                            "CreationDate": "2019-06-12T16:11:13.610+00:00",
                            "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                            "LastUpdateDate": "2019-06-12T16:11:15.917+00:00",
                            "links": [...]
                        }
                    ],
                    "count": 1,
                    "hasMore": false,
                    "limit": 24,
                    "offset": 0,
                    "links": [...]
                },
                "workMeasures": {
                    "items": [
                        {
                            "AssignWorkMeasureId": 300100180069639,
                            "EffectiveStartDate": "2019-06-12",
                            "EffectiveEndDate": "4712-12-31",
                            "Value": 1.5,
                            "Unit": "FTE",
                            "ActionCode": "HIRE_ADD_WORK_RELATION",
                            "ReasonCode": null,
                            "CreatedBy": "HCM_INTEGRATION_SPEC",
                            "CreationDate": "2019-06-12T16:11:13.674+00:00",
                            "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                            "LastUpdateDate": "2019-06-12T16:11:16.004+00:00",
                            "links": [...]
                        },
                        {
                            "AssignWorkMeasureId": 300100180069640,
                            "EffectiveStartDate": "2019-06-12",
                            "EffectiveEndDate": "4712-12-31",
                            "Value": 1,
                            "Unit": "HEAD",
                            "ActionCode": "HIRE_ADD_WORK_RELATION",
                            "ReasonCode": null,
                            "CreatedBy": "HCM_INTEGRATION_SPEC",
                            "CreationDate": "2019-06-12T16:11:13.698+00:00",
                            "LastUpdatedBy": "HCM_INTEGRATION_SPEC",
                            "LastUpdateDate": "2019-06-12T16:11:16.049+00:00",
                            "links": [...]
                        }
                    ],
                    "count": 2,
                    "hasMore": false,
                    "limit": 24,
                    "offset": 0,
                    "links": [...]
                },
                "links": [...]
            }
        ],
        "count": 1,
        "hasMore": false,
        "limit": 24,
        "offset": 0,
        "links": [...]
    },
    "links": [...]
}