Add a list of incidences
This endpoint allows registering a list of incidences for the same employee.
POST /api/v1/import/incidences
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:
{
"lag": 0,
"business": "BUSINESSID",
"employeeId": "C14A658",
"incidences": [
{
"type": "01",
"initTime": "09:00",
"endTime": "10:00",
"workedMinutes": 60,
"from": "2024-05-01",
"to": "2024-05-01",
"id": "C14-12547"
},
{
"type": "03",
"workedMinutes": 0,
"from": "2024-05-12",
"to": "2024-05-30",
"id": "C14-12549"
}
]
}
Considerations
This request will generate an atomic operation that can be automatically reversed if there are errors: the error will be displayed in the response of the request.
|
The |
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.
If several incidences in the list have validation errors, only the error of the first failing incidence is reported.
Error codes
In addition to the common errors, this endpoint can return the following codes:
| Code | Message | Description |
|---|---|---|
|
Lag mut be positive or zero |
The |
Business in employee incidences cannot be null |
The |
|
EmployeeId in employee incidences cannot be null |
The |
|
List of incidences in employee incidences 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 |
|
- |
A conflict occurred while saving the incidences. It is recommended to review that the data sent does not violate any integrity constraint. |