Hi everyone,
I try to import absences in Personio, but always get errors. When I try this on the developer hub, the errors are the same. What am I doing wrong?
Here is the question from the developer hub:
"https://api.personio.de/v1/company/attendances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "[{\"employee\":\"3213730\",\"date\":\"2021-05-31\",\"start_time\":\"06:19\",\"end_time\":\"15:30\",\"break\":45,\"comment\":\"Import aus Acclaro\"}]",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Authorization: Bearer eyJ0eXAiOiJKV....",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
The answer is:
{
"success":false
"error":{
"code":0
"message":"The given data was invalid."
"errors":{
"attendances":[
"Bitte geben Sie attendances ein, um fortzufahren."
]
}
}
}