Discussions

Ask a Question
Back to All

Writing Attendances Error: Start time yyyy-mm-dd has to be smaller than ende time

When I write attendances with the following payload (multiple sequential entries per day, per employee) I get a strange error like "Start time 2021-04-19T12:00:00.000Z has to be smaller than end time 2021-04-19T11:00:00.000Z"

I used your example python code within my IDE with this payload.

Why does this not work completely and what is the solution to this problem, please?
The only pattern I have found so far is, that after the second entry per day for one user, your API throws these errors.

In the following you'll find payload and response.

Payload

"attendances": [
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "11:00",
"start_time": "09:30"
},
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "12:00",
"start_time": "11:00"
},
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "14:00",
"start_time": "12:00"
},
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "14:45",
"start_time": "14:00"
},
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "16:15",
"start_time": "14:45"
},
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "18:45",
"start_time": "17:00"
}
]
}

Response

{
"error": {
"code": 400,
"detailed_message": [
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "11:00",
"error_msg": null,
"id": 65836124,
"start_time": "09:30",
"success": true
},
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "12:00",
"error_msg": null,
"id": 65836125,
"start_time": "11:00",
"success": true
},
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "14:00",
"error_msg": "Start time 2021-04-19T12:00:00.000Z has to be smaller than end time 2021-04-19T11:00:00.000Z",
"id": null,
"start_time": "12:00",
"success": false
},
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "14:45",
"error_msg": "Start time 2021-04-19T12:00:00.000Z has to be smaller than end time 2021-04-19T11:00:00.000Z",
"id": null,
"start_time": "14:00",
"success": false
},
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "16:15",
"error_msg": "Start time 2021-04-19T12:00:00.000Z has to be smaller than end time 2021-04-19T11:00:00.000Z",
"id": null,
"start_time": "14:45",
"success": false
},
{
"break": 0,
"comment": "",
"date": "2021-04-19",
"employee": 3152765,
"end_time": "18:45",
"error_msg": "Start time 2021-04-19T12:00:00.000Z has to be smaller than end time 2021-04-19T11:00:00.000Z",
"id": null,
"start_time": "17:00",
"success": false
}
],
"message": "Error when trying to insert Attendances periods rows"
},
"success": false
}