An API that connects multiple Microsoft services, enabling data access and automation across platforms
The 403 Forbidden error you are encountering when trying to access the GetStaffAvailability endpoint in Microsoft Graph typically indicates that the signed-in user does not have the necessary permissions or that consent for the required permissions has not been granted.
In your case, you mentioned having permissions for Bookings.Manage.All and Bookings.ReadWrite.All, but it seems that the calendar permissions are not reflecting in your access token. Here are a few steps you can take to troubleshoot this issue:
- Check Admin Consent: Ensure that the admin has granted consent for all required permissions, including those related to calendar access. Sometimes, even if you have the permissions assigned, they may not be effective until admin consent is fully granted.
- Verify Access Token: Make sure that the access token you are using includes all the necessary scopes. You can decode the JWT token to check the
scpclaim to confirm that the required permissions are present. - Modify Permissions Tab: If you see a message indicating that you need to consent to permissions on the Modify permissions tab, you might need to navigate to that section and ensure that all necessary permissions are granted.
- Token Expiration: If permissions were recently modified, ensure that you are using a fresh access token. Tokens can be cached, and you may need to request a new one to reflect the updated permissions.
- Contact Support: If the issue persists after checking the above points, consider reaching out to Microsoft support for further assistance.
References: