AndreC23
AndreC23

Reputation: 158

MS Teams Integration & Microsoft Graph API - Error calling Events API List calendars (/me/calendars)

I'm trying to integrate the MS Teams API in a Web-App. First of all i was trying to use the MS API from Postman to see the workflow.

On the Azure UI i have succesfully created an App-Registration: i have my ClientID, TenantID and i have created also the client secret.

I downloaded the Postman API from https://github.com/microsoftgraph/microsoftgraph-postman-collections and i can retrieve the App-Only Access token.

I created two users in a group and i logged them on MS Teams Application, they can chat.

I can also get the User Access Token and endpoints such

  1. https://graph.microsoft.com/v1.0/users
  2. https://graph.microsoft.com/v1.0/me
  3. etc..

are correctly working.

I am passing the User Access Token as Bearer token for the request.

These are the API permissions i gave: enter image description here

I am having issues with the endpoints in the folder Events like:

  1. https://graph.microsoft.com/beta/me/findRooms
  2. https://graph.microsoft.com/v1.0/me/calendars
  3. etc..

They all give the same error:

{
   "error":{
      "code":"NoUserFoundWithGivenClaims",
      "message":"The user specified by the user-context in the token does not exist.",
      "innerError":{
         "oAuthEventOperationId":"08e3abc3-3fdf-4d85-849d-7632ac0723d2",
         "oAuthEventcV":"CGW24oLIeEW1qoscgMIMTw.1.1",
         "errorUrl":"https://aka.ms/autherrors#error-InvalidUser",
         "requestId":"8e6cb242-17fe-4a94-8c89-912606578fb3",
         "date":"2021-03-09T12:04:27"
      }
   }
} 

I haven't found anything about this error. Can someone help me? Thanks.

Upvotes: 0

Views: 673

Answers (1)

Shiva Keshav Varma
Shiva Keshav Varma

Reputation: 3575

You can check your bearer token by putting it in jwt.ms and see if you have the required permissions in 'scp' claim.

If you are getting MailboxNotEnabledForRESTAPI then you need to check if you have the proper exchange license or not.

You can add license by going into Microsoft Admin Center -> Users -> Active Users -> Select your user -> Licenses

Upvotes: 1

Related Questions