question

Dina-8198 avatar image
0 Votes"
Dina-8198 asked saldana-msft edited

There are some restrictions on the API. Could you help me solve this problem, please?

We created an application in Microsoft azure, then invited one user(guest) to the application and created a new user.

Everything works with the main user, but with other users in some requests there are problems with access.

For example, POST https://graph.microsoft.com/v1.0/me/calendar/events through the guest in response comes: {"error":{"code":"NoPermissionsInAccessToken","message":"The token contains no permissions, or permissions can not be understood.","innerError":{"oAuthEventOperationId":"12745251-f429-45e0-a4f9-4a95a90221e5","oAuthEventcV":"fLdrEm/j0EqcBcj41KCANw.1.1.1","errorUrl":"https://aka.ms/autherrors#error-InvalidGrant","requestId":"893cc04d-ca38-4022-a948-bed22016a891","date":"2021-03-03T06:27:12"}}} via a new user: POST https://graph.microsoft.com/v1.0/me/calendar/events { "error": { "code": "MailboxNotEnabledForRESTAPI", "message": "REST API is not yet supported for this mailbox." } }

microsoft-graph-teamworkmicrosoft-graph-usersmicrosoft-graph-identity
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Deva-MSFT avatar image
0 Votes"
Deva-MSFT answered

I see that you're trying to access other users calendar events and its failing with error. Please note that you're using "/me" endpoint. If you want to access other users calendar then the API would look like this "POST /users/{id | userPrincipalName}/events". Try this one and see if it works. In case if you're using Client Credential to access other users mailboxes/calendar then make sure you provide the necessary permissions so that you can access them without any issue. You can check the same by validating its token using https://jwt.ms as well.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.