Forum Discussion

fh_aimcom's avatar
fh_aimcom
Copper Contributor
Aug 17, 2023

Update of full-day event results in "OverBooking Slot" error message when using app access token

I'm using the Microsoft Graph API with the PHP package microsoft/microsoft-graph. I want to update an appointment and add a new customer to it. This works fine as long as the event has a duration of e.g. 4 hours (from 08:00 to 12:00) and even if the event is at night time outside of normal working hours. But as soon as I check the checkbox for a full-day event and send an API request for it, I get a response "400 Bad Request" for a PATCH request to https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/{bookingBusiness-id}/appointments/{bookingAppointment-id}:

 

{
	"code": "UnknownError",
	"message": "{\"error\":{\"message\":\"OverBooking Slot\",\"code\":\"Bad Request\"}}",
}

 

 

By using a personal access token from the Microsoft Graph Explorer (and not the API app access token), I can successfully submit a request for a full-day event and add a new customer (as long as I don't include the attributes "selfServiceAppointmentId" and "anonymousJoinWebUrl", but that's another story).

 

Does anybody have an idea why I get an error message when using the app access token and how I could avoid it?

  • TimM1's avatar
    TimM1
    Copper Contributor
    I've been troubled with issues like this for a long time. The problems are getting worse and it appears the API backend is changing without notice.
    The API behaves differently depending on if you are using an app token or a user token. So you might like to change over to a different token strategy to see if that helps your issue. Timezone issues with the API can also come into it.

    I've also found that the overbooking can be caused by buffer times. e.g. if you try to schedule an appointment for the start of a work day (8:00), but a 30min buffer is set this will fail with an OverBooking Slot message. So check your buffers don't run over the start/end of workday or overlap with other appointments or other appointment buffers.

    The api is severely lacking decent return messages. In some cases it can return success messages but the update didn't actually work in the backend.

Resources