Hello Steven Bitaxi,
The error is because you have granted Bookings.ReadWrite.All
, but to access /appointments
endpoint you also need to grant BookingsAppointment.ReadWrite.All
application permission to the Microsoft Entra ID application.
Hence to resolve the error, grant BookingsAppointment.ReadWrite.All
application permission too:
I generated access token using client credential flow:
GET https://login.microsoftonline.com/TenantID/oauth2/v2.0/token
client_id:
client_secret:
scope: https://graph.microsoft.com/.default
grant_type: client_credentials
Make sure BookingsAppointment.ReadWrite.All
role is also present in access token:
Now I am able to call the Get booking Appointment API successfully:
GET https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/******@xxx.onmicrosoft.com/appointments/AppointmentID
With Bookings.ReadWrite.All
role only I got 500 error:
Hope this helps!
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful, which may help members with similar questions.
If you have any other questions or are still experiencing issues, feel free to ask in the "comments" section, and I'd be happy to help.