首页 > 解决方案 > Microsoft Graph 订阅 - 通话记录

问题描述

所以我有一个用例,我需要接收来自 Microsoft Teams 通话的通话记录。我在 Microsoft Graph 调用上找到了允许这样做的文档,位于:( https://docs.microsoft.com/en-us/graph/api/callrecords-callrecord-get?view=graph-rest-1.0 )。

在此页面中,它还提到可以使用 Graph Subscriptions 将通话记录发送到网络挂钩。(https://docs.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=http)。

它说我需要向https://graph.microsoft.com/CallRecords.Read.All授予应用程序 API 权限。我创建了一个只有此权限的新应用程序注册。

我为该组织做了行政许可。

我从https://login.microsoftonline.com/{tenantId}/v2.0请求了一个不记名令牌,范围为https://graph.microsoft.com/.default

我发布到https://graph.microsoft.com/v1.0/subscriptions,正文如下:

{
  "changeType": "created",
  "notificationUrl": "xxx",
  "resource": "/communications/callRecords",
  "expirationDateTime": "2021-03-03T11:00:00.0000000Z"
}

在接收通知的端点上,我正在使用验证令牌进行回复,并且我看到请求/响应从 Graph API 传入我的端点,并且它成功返回了带有令牌的 200。

我的帖子回复返回 403 Forbidden。

{
  "error": {
    "code": "ExtensionError",
    "message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: The request is not authorized for this user or application.]",
    "innerError": {
      "date": "2021-03-02T15:32:36",
      "request-id": "21ac082f-e2a4-41e0-badf-4672e5b05cc8",
      "client-request-id": "21ac082f-e2a4-41e0-badf-4672e5b05cc8"
    }
  }
}

关于我缺少哪一步的任何想法?

标签: microsoft-graph-apimicrosoft-graph-sdksmicrosoft-graph-teams

解决方案


确保您指向正确的应用注册


推荐阅读