GraphApi bookingBusinesses/bookingappointment POST calls fails with 500 UnknownError

jop 1 Reputation point
2022-11-18T10:43:18.93+00:00

I'm following docs from https://learn.microsoft.com/en-us/graph/api/bookingbusiness-post-appointments?view=graph-rest-1.0 how to create appointment into Bookings calendar. My app will be service kind application, it is granted with needed permissions and I'm able to get token for it.

From Bookings webview, I can create appointments and modify, when using postman I can use GET methods for endpoints. But all tries with creating appointment fails with error, usually 500 and UnknownError.

I have been trying POST as docs describe but it fails. Then with example request data from docs and it fail. I also created new appointment from web, then used GET endpoint to get all appointments. I took one appointment, removed id field and POSTed it but that fails too. Document after all is not helpful, what is actual data to create new appointment with endpoints?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,271 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,746 Reputation points Microsoft Vendor
    2022-11-18T10:55:36.437+00:00

    Hello @jop ,

    Looks like you are using Application Permissions to create a booking appointment, if you create a custom app using application permissions, you must follow the Business rules validation.
    If the request payload with not in line with the business rules, Graph throws 500 - UnknownError.

    Hope this helps.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.