Calls Graph API – Error Request Authorization Tenant Mismatch.

Recently I had been trying Calls Graph API and particularly wanted to write a program where a scheduled meeting can be started by Azure Bot. I was following documentation at this link.

While trying the API from Postman, I was getting below error.

Error –  Request Authorization Tenant Mismatch.

In Example 5 below, It says we have to Request object like below

https://docs.microsoft.com/en-us/graph/api/application-post-calls?view=graph-rest-1.0&tabs=http#example-5-join-scheduled-meeting-with-service-hosted-media

Screenshot of request object from Offical Doc.

While using above request in Postman I was getting below error.

Cannot Create Call – Error Code 7505 “Request Authorization Tenant Mismatch.”

To resolve this, we have to pass tenantId also at 2 places 1) one in user object 2) at root level.

If you notice below this is missing in MS docs but after passing this  we will be able to get response from API.

{
  "@odata.type": "#microsoft.graph.call",
  "callbackUri": "https://03975652e7e3.ngrok.io/api/calling",
  "requestedModalities": [
    "audio"
  ],
  "mediaConfig": {
    "@odata.type": "#microsoft.graph.serviceHostedMediaConfig",
    "preFetchMedia": [
     {
       "uri": "https://cdn.contoso.com/beep.wav",
       "resourceId": "f8971b04-b53e-418c-9222-c82ce681a582"
     },
     {
       "uri": "https://cdn.contoso.com/cool.wav",
       "resourceId": "86dc814b-c172-4428-9112-60f8ecae1edb"
     }
    ],
  },
  "chatInfo": {
    "@odata.type": "#microsoft.graph.chatInfo",
    "threadId": "19:d84b4194fcbf44e2b00fb5d022fb25a9@thread.tacv2",
    "messageId": "123123123",
    "ReplyChainMessageId" : "12312312"
  },
  "meetingInfo": {
    "@odata.type": "#microsoft.graph.organizerMeetingInfo",
    "organizer": {
      "@odata.type": "#microsoft.graph.identitySet",
      "user": {
        "@odata.type": "#microsoft.graph.identity",
        "id": "<AADUSERIDFROMAZUREPORTAL>",
        "tenantId": "<TENANTID>",
        "displayName": "MeetingBot222"
      }
    },
    "allowConversationWithoutHost": true
  },
  "tenantId": "<TENANTID>"
}

 

(Visited 874 times, 1 visits today)