Create an employee using rest api — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Create an employee using rest api

Dear All,

I am attempting to create an employee using the following REST API: /hcmRestApi/resources/11.13.18.05/workers.

Here is the request body:

{

    "DateOfBirth": "2023-11-20",

    "names": [

        {

            "LastName": "test",

            "FirstName": "test",

            "MiddleNames": null,

            "LegislationCode":"SA"

        }

    ],

    "addresses": [

        {

            "AddressType": "HOME",

            "AddressLine1": "test",

            "AddressLine2": null,

            "AddressLine3": null,

            "AddressLine4": null,

            "TownOrCity": "test",

            "Region1": null,

            "Region2": null,

            "Region3": null,

            "Country": "SA",

            "PostalCode": null

        }

    ],

    "emails": [

        {

            "EmailType": "W1",

            "EmailAddress": "test@example.com"

        }

    ],

    "workRelationships": [

        {

            "LegalEmployerName": "test",

            "WorkerType": "E",

            "StartDate":"2023-12-09",

            "assignments": [

                {           

                    "BusinessUnitName": "KSA BU1",

                    "ActionCode": "HIRE",

                    "JobCode": "01",

                    "LocationCode": "MST_location_KSA BU1",

                    "DepartmentName": "Administration",

                    "managers": [

                        {

                            "ManagerAssignmentNumber": "E100022-2",

                            "ManagerType": "LINE_MANAGER"

                        }

                    ]

                }

            ]

        }

    ]

}


However, each time I try to set the start date ( "StartDate") attribute differently that the sysdate in the workrelationship object , I encounter the following error:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!