Add an incidence
This endpoint allows registering the information of an incidence for an employee.
POST /api/v1/import/incidence
Below is a detailed explanation of each of the fields that can make up the request body, with some being mandatory for the request to be successful.
|
Mandatory fields are marked with an asterisk (*). |
Request body
| JSON Analysis |
|---|
Details
|
Request example
Once the analysis of the different fields has been done, an example of the request body is shown:
{
"business": "BUSINESSID",
"employeeId": "C14A658",
"type": "01",
"initTime": "08:30",
"endTime": "09:30",
"workedMinutes": 30,
"from": "2024-04-15",
"to": "2024-04-15",
"id": "C14-12545"
}
Considerations
This request will generate an atomic operation that can be automatically rolled back if there are errors: the error will be displayed in the response of the request.
If the indicated employee identifier does not exist in the business, the request will return a 200 OK status, indicating the not_valid_person error in the response.
Error codes
In addition to the common errors, this endpoint can return the following codes:
| Code | Message | Description |
|---|---|---|
|
Business in incidence cannot be null |
The |
EmployeeId in incidence cannot be null |
The |
|
Type in incidence cannot be null |
The |
|
Worked minutes cannot be null / Worked minutes should be positive or zero |
The |
|
From in incidence cannot be null / To in incidence cannot be null |
The |
|
Init Time is invalid. Format should be: HH:mm / End Time is invalid. Format should be: HH:mm |
The |
|
Incidence range is invalid |
The range defined between |
|
|
has_not_type |
The incidence type indicated in |
error.incidence_overlapped |
The incidence overlaps with another incidence previously registered in the system. |
|
error.incidence_time_mandatory |
The incidence type requires start and end times ( |
|
validation.error.incidence_input_type_not_allowed |
The indicated incidence type does not support being created through this request. |
|
|
- |
A conflict occurred while saving the incidence. It is recommended to review that the data sent does not violate any integrity constraint. |
Useful links
What is an incidence?