Discussions

Ask a Question
Back to All

API Endpoint Not Found for Attendance Update

Dear Personio Support Team,

I hope this message finds you well. I am currently integrating an internal system with the Personio API to manage employee attendance records. However, I am encountering an issue when attempting to update an existing attendance record using the API. Specifically, I am receiving a "Not Found" error when I make a request to update the attendance. When I use the exact same attendance ID to search using your testing tool on the documentation it works without issue.

Is this a known error or is there anything more you can tell me using the personio_trace_id?

Issue Details

Error Message:

{
    "personio_trace_id": "17c5ce36-e36f-4b0e-84f0-4be38e1d7c72",
    "timestamp": "2024-07-19T17:42:30Z",
    "errors": [
        {
            "title": "Not Found",
            "detail": "The endpoint with /v1/company/attendances/392086375 was not found.",
            "type": "https://developer.personio.de/v2.0/page/public-api-error-codes#apinot_found",
            "_meta": {
                "path": "/v1/company/attendances/392086375"
            }
        }
    ]
}

Code snippet

        url = f"https://api.personio.de/v1/company/attendances/{attendance_id}"
        payload = {
            "date": str(date.today()),
            "end_time": end_time.strftime('%H:%M'),
            "break": 30,
            "skip_approval": True
        }
        
        headers = {
            "accept": "application/json",
            "content-type": "application/json",
            "authorization": f'Bearer {personio_auth}'
        }
        
        response = requests.put(url, json=payload, headers=headers)
        response_data = response.json()

Thanks so much for your help here.

Best wishes,
Cathal