[英]MS Teams - Rich notification are not supported for this resource in 'app + user' context (Graph API)
I'm trying to set up rich notifications for a channel subscription like in the docs below.我正在尝试为频道订阅设置丰富的通知,如下面的文档所示。
New or changed messages in a specific Teams channel: /teams/{id}/channels/{id}/messages特定团队频道中的新消息或更改消息:/teams/{id}/channels/{id}/messages
I'm supplying the details to the subscription url like below with ROPC auth flow.我正在使用 ROPC 身份验证流程向订阅 URL 提供详细信息,如下所示。
{
"changeType": "created,updated",
"notificationUrl": "https://f554-118-110-222-226.ngrok.io/api/teams/events",
"resource": "teams/TEAM_ID/channels/CHANNEL_ID/messages",
"expirationDateTime": "2021-10-20T02:55:53Z",
"encryptionCertificate": "encryptionCertificate",
"encryptionCertificateId": "encryptionCertificateId",
"includeResourceData": true,
}
I should have all permissions necessary to access this resource since I can create a subscription when includeResourceData is false .我应该拥有访问此资源所需的所有权限,因为我可以在 includeResourceData 为 false 时创建订阅。 However, I'm getting the following error when includeResourceData is true and I supply an encryption cert.但是,当 includeResourceData 为 true并且我提供加密证书时,我收到以下错误。
Operation: Create;操作:创建; Exception: [Status Code: BadRequest;例外:[状态代码:BadRequest; Reason: Rich notification are not supported for this resource in 'app + user' context.原因:在“应用 + 用户”上下文中,此资源不支持丰富的通知。 Please set includeResourceData field to false.]请将 includeResourceData 字段设置为 false。]
I think it might be with how my auth and permissions are set up but I'm not entirely sure what this means.我认为这可能与我的身份验证和权限的设置方式有关,但我不完全确定这意味着什么。 Any help is appreciated任何帮助表示赞赏
Would Suggest you to please try to revalidate and setup all the below prerequisite if might you have missed while setup change notification for team's channel.如果您在设置团队频道的更改通知时错过了,建议您尝试重新验证并设置以下所有先决条件。
Other way to subscribe notifications for channel messages dynamically(eg powerapp - current user can subscribe to all of his joinedTeams or selected teams and receives push notifications) Because Ms Flows and Logic apps only lets you setup one at a time.动态订阅频道消息通知的其他方式(例如 powerapp - 当前用户可以订阅他所有加入的团队或选定的团队并接收推送通知) 因为 Ms Flows 和 Logic 应用程序只允许您一次设置一个。
Please follow this MS Document for Set up change notifications that include resource data while creating subscription.在创建订阅时,请按照此MS 文档设置包含资源数据的更改通知。
Reference: is team channel messages allowed for change notifications beta?参考: 是否允许团队频道消息用于更改通知测试版? · Issue #3977 · microsoftgraph/microsoft-graph-docs · GitHub · 问题 #3977 · microsoftgraph/microsoft-graph-docs · GitHub
Found the answer to my question in this block of the docs.在此文档块中找到了我的问题的答案。 Thanks to RahulKumarShaw-MT for linking the right version.感谢 RahulKumarShaw-MT 链接正确的版本。
https://docs.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-beta&tabs=http#chatmessage https://docs.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-beta&tabs=http#chatmessage
The error below means that since the app was using ROPC auth flow it falls under delegated permissions and is not supported by the API to send encrypted data.下面的错误意味着由于应用程序使用ROPC 身份验证流,它属于委托权限,并且API 不支持发送加密数据。
Operation: Create;操作:创建; Exception: [Status Code: BadRequest;例外:[状态代码:BadRequest; Reason: Rich notification are not supported for this resource in 'app + user' context.原因:在“应用 + 用户”上下文中,此资源不支持丰富的通知。 Please set includeResourceData field to false.]请将 includeResourceData 字段设置为 false。]
I got around this by having to set up an additional auth token with app permissions set up specifically for this purpose.我通过设置一个额外的身份验证令牌来解决这个问题,该令牌具有专门为此目的设置的应用程序权限。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.