如何解决Graph API 过期订阅仍可从订阅列表中检索
我认为使用“GET /subscriptions”的订阅列表应该只显示活动订阅,即不包括已过期的订阅。
但是,我遇到了一个租户的问题,其中过期的订阅是订阅列表的一部分。以下是我刚刚检索到的订阅列表,它们都已过期:
{
"@odata.context": "https://graph.microsoft.com/beta/$Metadata#subscriptions","value": [
{
"id": "45a12267-662d-4997-a5b2-...","resource": "/teams/getAllMessages","applicationId": "appid...","changeType": "created,updated,deleted","clientState": null,"notificationUrl": "https://url.com","notificationQueryOptions": null,"notificationContentType": "application/json","lifecycleNotificationUrl": null,"expirationDateTime": "2021-06-23T08:59:00.0004497Z"
},{
"id": "44cd97cc-0a17-46a7-b9c0-...","expirationDateTime": "2021-06-23T09:59:00.0000472Z"
},{
"id": "ec91353f-6fc5-428a-9145-...","expirationDateTime": "2021-06-23T18:58:59.9998227Z"
},{
"id": "64947372-832f-405a-99e5-...","expirationDateTime": "2021-06-23T22:58:59.9998244Z"
},{
"id": "62c8d07f-4cc9-4d42-88a1-...","expirationDateTime": "2021-06-23T03:59:00.0004433Z"
},{
"id": "83f06882-600d-42b0-8d20-...","expirationDateTime": "2021-06-24T05:58:59.9995389Z"
}
]
}
DELETE /subscriptions/83f06882-600d-42b0-8d20-...
{
"error": {
"code": "ExtensionError","message": "Operation: Delete; Exception: [Status Code: NotFound; Reason: NotFound]","innerError": {
"date": "2021-06-30T03:17:01","request-id": "27496aff-5e3e-4bda-9184-a2f248cef30f","client-request-id": "27496aff-5e3e-4bda-9184-a2f248cef30f"
}
}
}
GET /subscriptions/83f06882-600d-42b0-8d20-...
{
"error": {
"code": "ExtensionError","message": "There was an error processing a storage extension.","innerError": {
"date": "2021-06-30T03:15:40","request-id": "ba9a3046-6a93-4058-ac22-f83dbc4ceed8","client-request-id": "ba9a3046-6a93-4058-ac22-f83dbc4ceed8"
}
}
}
更新了代码以包含 GET/DELETE 请求的请求 ID。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。