简体   繁体   English

MS Teams - 在“应用 + 用户”上下文(图形 API)中,此资源不支持丰富的通知

[英]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.如果您在设置团队频道的更改通知时错过了,建议您尝试重新验证并设置以下所有先决条件。

  • you need to include "includeResourceData" set to "true" and provide certificate information as described here您需要将“includeResourceData”设置为“true”并提供此处所述的证书信息
  • you need to get your application approved你需要让你的申请获得批准

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.

相关问题 使用 MS Graph API 和 Postman 调用 Teams,不受支持的 AAD 身份 - Use MS Graph API and Postman to call Teams, Unsupported AAD Identity MS Teams 集成和 Microsoft Graph API - 调用事件时出错 API 列出日历 (/me/calendars) - MS Teams Integration & Microsoft Graph API - Error calling Events API List calendars (/me/calendars) 无法在 MS Graph 平台中使用 Teams OnlineMeeting API 的工作帐户获取令牌 - Unable to get Token with Work Account for Teams OnlineMeeting API within MS Graph platform 如何知道用户是否可以在MS Graph API中编辑/删除用户 - How to know if user can edit/delete user in MS Graph API MS Teams 应用程序:访问此应用程序时出现问题 - MS Teams App: There was a problem reaching this app 使用 MS Graph API 向应用注册添加更多应用角色 - Using MS Graph API to add more app roles to an app registration 如何从MS Graph API获取用户的基本详细信息 - How to get user's basic details from MS Graph API MS Graph API C#将用户添加到组 - MS Graph API C# Add user to group MS Graph API:本地 AD 用户密码重置错误 - MS Graph API: On-prem AD user password reset error API下载MS Teams录像 - API to download MS Teams video recordings
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM