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 | Params | Required | Type | Description | | --- | --- | --- | --- | | email | Mandatory | String | The email address of the employee. | | mobile | Mandatory | String | The mobile/phone number of the employee. | | code | Mandatory | String | The employee code or identification number. | | name | Mandatory | Object | The name of the employee. | | fullName | Mandatory | String | The full name of the employee. | | firstName | Optional | String | The first name of the employee. | | lastName | Optional | String | The last name of the employee. | | department | Mandatory | String | The department to which the employee belongs. | | office | Mandatory | String | The office location of the employee. | | dob | Optional | Integer | The date of birth of the employee in Unix timestamp format. | | grade | Mandatory | Mandatory | The grade or level of the employee. | | gender | Optional | String | The gender of the employee. | | manager | Optional | String | The manager of the employee. | | alternate | Optional | String | The alternate contact information for the employee. | | hrHead | Optional | String | The HR head or contact person for the employee. | | additionalFirst | Optional | String | Additional information field. | | additionalSecond | Optional | String | Additional information field. | | active | Mandatory | Boolean | Indicates 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. ``` json { "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. ``` json { "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. ``` json { "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. ``` json { "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. ``` json { "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. ``` json {"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