user35131
user35131

Reputation: 23

I get an error code 401 when create a call use graph explorer

I try to create a call using graph explorer, but i get an error code 401 and a message as "Looks like you may not have the permissions for this call. Please modify your permissions. "

I already set permissions through Azure active directory.

Calls.Initiate.All
Calls.InitiateGroupCall.All
Calls.JoinGroupCall.All
Calls.JoinGroupCallAsGuest.All

request as follows:

POST https://graph.microsoft.com/beta/app/calls
Content-Type: application/json

{
  "callbackUri": "https://bot.contoso.com/api/calls",
  "mediaConfig": {
    "@odata.type": "#microsoft.graph.appHostedMediaConfig",
    "blob": "<media config blob>"
  },
  "requestedModalities": [ "audio" ],
  "source": {
    "identity": {
      "application": {
        "id": "MyRealApplicationCode",
        "tenantId": MyRealTenantId,
        "displayName": "IT Bot"
      }
    },
    "languageId": "languageId-value",
    "region": "region-value"
  },
  "subject": "Test Call",
  "targets": [
    {
      "identity": {
        "user": {
          "id": "MyRealUserId",
          "tenantId": MyRealTenantId,
          "displayName": "Heidi Steen"
        }
      }
    }
  ],
  "tenantId": "tenantId-value"
}

response as follows:

{
    "error": {
        "code": "UnknownError",
        "message": "{\"errorCode\":\"9000\",\"message\":\"Unsupported AAD Identity.\",\"instanceAnnotations\":[]}",
        "innerError": {
            "request-id": "b0232477-048b-486b-9d43-77aacfb3fa2f",
            "date": "2019-07-16T06:44:00"
        }
    }
}

Upvotes: 1

Views: 170

Answers (1)

Tony Ju
Tony Ju

Reputation: 15609

You can not use graph explorer to test this api since this api does't support delegated permission which used by graph explorer. Here is the difference between delegated permission and application permission.

enter image description here

You need to get an access token by using client credentials flow, then use this access token to call this api. Refer to this document for the detailed steps.

Upvotes: 1

Related Questions