Skip to navigation

Create New Employee

View as Markdown

This API endpoint is used to create a new employee in the external system. The request should be sent as an HTTP POST to {{host}}/apis/external/employee/create with the required payload in the raw request body.

Request Payload

ParamsRequiredTypeDescription
emailMandatoryStringThe email address of the employee.
mobileMandatoryStringThe mobile/phone number of the employee.
codeMandatoryStringThe employee code or identification number.
nameMandatoryObjectThe name of the employee.
fullNameMandatoryStringThe full name of the employee.
firstNameOptionalStringThe first name of the employee.
lastNameOptionalStringThe last name of the employee.
departmentMandatoryStringThe department to which the employee belongs.
officeMandatoryStringThe office location of the employee.
dobOptionalIntegerThe date of birth of the employee in Unix timestamp format.
gradeMandatoryMandatoryThe grade or level of the employee.
genderOptionalStringThe gender of the employee.
managerOptionalStringThe manager of the employee.
alternateOptionalStringThe alternate contact information for the employee.
hrHeadOptionalStringThe HR head or contact person for the employee.
additionalFirstOptionalStringAdditional information field.
additionalSecondOptionalStringAdditional information field.
activeMandatoryBooleanIndicates whether the employee is active or not.

Response

The response will contain a success field, which will be set to true if the employee creation was successful.

Error Responses

In case of errors or missing information, the API will provide corresponding error messages. Below are the possible error scenarios along with their respective JSON responses:
t

1. Grade Not Provided

This error occurs when the grade field is not filled in the request.

{
"message": "Grade is required",
"error": "Grade is required"

2. Office Not Provided

This error occurs when the office information is not provided in the request.

{
"message": "Office is required",
"error": "Office is required"
}

3. Department Not Provided

This error denotes that the request did not include the employee’s department information.

{
"message": "Office is required",
"error": "Office is required"
}

4. Manager Not Found

This error indicates that the specified manager could not be found in the system.

{
"message": "8456 Manager not found ",
"error": "8456 Manager not found "
}

5. Duplicate Employee Code

This error occurs when an attempt is made to create an employee with a code that already exists in the system.

{
"message": "Employee Already exists with same employee code",
"error": "Employee Already exists with same employee code"
}

6. Name Not Provided

This error signifies that the request did not include the employee’s name.

{"message":"000059 can't be uploaded due to {"message":"Invalid value for name provided","error":"Invalid value for name provided"}
","error":"000059 can't be uploaded due to {"message":"Invalid value for name provided","error":"Invalid value for name provided"}
"}

Headers

DICE-APP-IDstringOptional
Company Code of client
X-CLIENT-IDstringOptional
API Client ID
X-CLIENT-SECRETstringOptional
API Client Secret

Request

This endpoint expects an object.
dataobjectRequired

Response

OK
successboolean

Errors

409
Conflict Error
502
Bad Gateway Error