Microsoft Graph订阅-呼叫记录



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

在这个页面中,它还提到通话记录可以使用图形订阅发送到web钩子。(https://learn.microsoft.com/en - us/graph/api/subscription subscriptions?view=graph -休息- 1.0后,标签= http)。

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

我为组织做了行政同意。

我从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。

My Post response with 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"
}
}
}

你知道我错过了哪一步吗?

确保你指向正确的App Registration

最新更新