Discussions

Ask a Question
Back to All

POST Attendances

Hello,
I'm trying to transfer multiple attendances using the same syntax as described in the developer hub. I keep getting the error (401) Nicht autorisiert.

What am I doing wrong.

Here is the code (poweshell)

$headers=@{}
$headers.Add("accept", "application/json")
$headers.Add("content-type", "application/json")
$headers.Add("authorization", "Bearer pa....")
$response = Invoke-WebRequest -Uri 'https://api.personio.de/v1/company/attendances' -Method POST -Headers $headers -ContentType 'application/json' -Body {"attendances":[{"employee":3213730,"date":"2024-01-12","start_time":"06:47","end_time":"17:57","break":190,"comment":"Test2 Übertragung von TA Zeitblick"},
{"employee":3213730,"date":"2024-01-15","start_time":"06:39","end_time":"16:03","break":30,"comment":"Test3 Übertragung von TA Zeitblick"},
{"employee":3213730,"date":"2024-01-16","start_time":"06:46","end_time":"16:16","break":30,"comment":"Test4 Übertragung von TA Zeitblick"}]}

Kind regards, Bert