Employee-PUT

This article explains the request to update the employee object.

Update an employee

PUT /xEmployee

Update an employee using the employee ID or any other unique employee attribute. The new values for the fields to be updated should be sent in the request body in JSON format. 

To identify the employee record to be updated, you can either use 

  • Employee Id - which is the existing ID of the employee. This ID cannot be changed. 
    For example, 
    Request URL:
    PUT https://corehr-api.hrcloud.com/v1/cloud/xEmployee

    Request Body:

    [
    {
    "Id": "29c00ddd295e7365746ed698060bf08c",
    "xAddress": "New Zealand"
    }
    ]

    In this case, ID is used to identify the record for which the address field is to be updated.

  • Use an employee field (such as ?identifier = xEmail). In this case, ID is not sent in the payload or request body. For example, 
    Request URL:
    PUT https://corehr-api.hrcloud.com/v1/cloud/xEmployee?Identifier=xEmail

    Request Body:

    [
    {
    "xEmail": "peterK@hrcloud.com",
    "xAddress": "New Zealand"
    }
    ]

Update an employee record using mapping parameters

PUT /xEmployee?{mappingParams}

Update an employee using the specified ID (or field in the method), and mapping parameters sent as query parameters.

PUT https://corehr-api.hrcloud.com/v1/cloud/xEmployee?mapping=xDepartmentLookup to xDepartmentCode,xManagerLookup to xEmail

Request Body:

[
{
"Id": "0e7040587336430e",
"xManagerLookup": {
"xEmail": "emp1@phone.com"
},
"xDepartmentLookup": {
"xDepartmentCode": "Executive"
}
}
]

Update an employee profile Picture

PUT /xEmployee/Picture

Used to update the profile picture of an employee using the employee ID and the three parameters of the new picture(resource) to be uploaded. These params are referred to as smallResourceId, mediumResourceId and originalResourceId. It is mandatory to provide all the three parameters otherwise the update request will fail. For example - 

For example, Request:

PUT https://corehr-api.hrcloud.com/v1/cloud/xEmployee/Picture

Input parameters:

{
"Id":"4e6f06d23efa2fb799d7eefe5e03e665",
"smallResourceId": "7a8319932238f45bd0a546eeab3aa5e2",
"mediumResourceId": "7a8319932238f45bb355dacb1e108741",
"originalResourceId": "7a8319932238f45b08a1576168546b44"
}