Microsoft Graph允许用户在目标资源上创建订阅,以接收关于订阅的更改通知。最近,微软推出了一个功能,通过在创建订阅的API的有效负载中将includeResourceData属性的值设置为“true”来为Microsoft Teams创建丰富的通知。
随着includeRresourcedata的引入,微软将从2021年1月1日起在Microsoft Graph beta终结点上作废includeProperties属性。如果您的Microsoft Teams应用目前使用includeProperties资源,请立即更新它以使用includeResourceData,以确保您的代码仍然工作。
更多信息请访问Set up change notifications that include resource data
下面是通过includeResourceData属性创建更改通知订阅的示例:
POST https://graph.microsoft.com/beta/subscriptions Content-type: application/json { "resource":"teams/getAllMessages", "changeType":"created,updated", "clientState":"ClientSecret", "notificationUrl":"https://webhookappexample.azurewebsites.net/api/notifications", "expirationDateTime":"2020-11-01T18:00:36.9592725+00:00", "includeResourceData":true, "encryptionCertificate":"MIIDQjCCAiqgAwIBAgIQRql6VVODTX2XXXXXXXXXXXXXXXXX", "encryptionCertificateId":"4ca5c96d4713489baf1166b7d26a8de9" }