Forum Discussion

PlinioGatto's avatar
PlinioGatto
Copper Contributor
Nov 14, 2023

"End time can not be a past date." on getStaffAvailability

Today a request to getStaffAvailability that was working no longer works, has anyone experienced the same issue?

 

We are using Bookings APIs with application permissions.

 

API: https://learn.microsoft.com/en-us/graph/api/bookingbusiness-getstaffavailability?view=graph-rest-1.0&tabs=http

 

Request body:

 

 

 

{
    "staffIds": [
        ...
    ],
    "startDateTime": {
        "dateTime": "2023-07-04T07:00:00",
        "timeZone": "UTC"
    },
    "endDateTime": {
        "dateTime": "2023-08-04T22:00:00",
        "timeZone": "UTC"
    }
}

 

 

 

 

 

Response:

 

 

 

{
    "error": {
        "code": "UnknownError",
        "message": "{\"error\":{\"message\":\"End time can not be a past date.\",\"code\":\"Bad Request\"}}",
        "innerError": {
            "date": "2023-11-14T09:23:47",
            "request-id": ...,
            "client-request-id": ...
        }
    }
}

 

 

 

 

 

 

 

  • PlinioGatto's avatar
    PlinioGatto
    Copper Contributor
    The API returned an error because we were checking availability in the past, checking availability in the future works correctly.

    Sorry for the oversight.

Resources