Discussions

Ask a Question
Back to All

post attendances returning 400 Bad Request

i am sending the payload : json_encode($data) where

$data =['attendances' =>[
["employee" => 16527768,
"date" => "2023-07-07",
'start_date' => "2023-07-07",
'end_date' => "2023-07-07",
"start_time" => "08:00",
"end_time" => "11:00",
"break" => 15,
"project_id" => null,
"comment" => "Some comment",
]
]];

wich is equivalent to
{
"attendances": [
{
"employee": 16527768,
"date": "2023-07-07",
"start_date": "2023-07-07",
"end_date": "2023-07-07",
"start_time": "08:00",
"end_time": "11:00",
"break": 15,
"project_id": null,
"comment": "Some comment"
}
]
}

I don't understand why a 400 with this payload pops up! there is no start_date and end_date in the Api documentation.

"errors" => array:2 [
"start_date" => array:1 [
0 => "Bitte geben Sie start date ein, um fortzufahren."
]
"end_date" => array:1 [
0 => "Bitte geben Sie end date ein, um fortzufahren."
]
]

Any one got any ideas, what is wrong here?