为多个用户订阅 MS Graph API 中的状态

Subscribing to presence in MS Graph API for multiple users

我目前正在尝试通过 MS Graph API SDK (Beta) 检索 Teams 状态信息。仅订阅某些用户时,一切都运行顺利。一旦用户数量变大,问题就开始了。我希望有人能澄清一下:

基本上我是按照上面提到的那样做的 here:

Subscription = Client.Subscriptions.Request().AddAsync(new Subscription
{
   Resource = $"/communications/presences?$filter=id in ('<guid>','<guid>',...))",
   ChangeType = "updated",
   ...
}).Result

问题 1:两个订阅,每个 user/presence

一切正常后,我尝试创建多个订阅。在我的测试案例中,有两个订阅,每个订阅都有一个联系人。尝试创建第二个订阅无效并出现错误 "Operation: Create; Exception: [Status Code: Conflict; Reason: A subscription already exists. It must be deleted before a another can be made.]" 我现在想知道我是否做错了什么或者这是一个限制(没有在文档中找到任何内容)。 我希望我做错了什么,因为目标是监控比上面链接文章中提到的 650 名用户更多的用户。我得到的错误:

Code: ExtensionError
Message: Operation: Create; Exception: [Status Code: Conflict; Reason: A subscripton already exists. It must be deleted before a another can be made.]
Inner error:
    AdditionalData:
    date: 2020-11-08T20:47:37
    request-id: 9d45a16b-9cac-4515-92f9-b81b36318189
    client-request-id: 9d45a16b-9cac-4515-92f9-b81b36318189
ClientRequestId: 9d45a16b-9cac-4515-92f9-b81b36318189

问题 2:一个订阅,多个 users/presences

之后,我尝试为超过三个测试用户创建一个订阅,遗憾的是它也没有按预期工作:

Code: ExtensionError
Message: Operation: Create; Exception: [A task was canceled.]
Inner error:
    AdditionalData:
    date: 2020-11-08T20:38:30
    request-id: c6398df3-c856-4f80-9495-0b76714d9592
    client-request-id: c6398df3-c856-4f80-9495-0b76714d9592
ClientRequestId: c6398df3-c856-4f80-9495-0b76714d9592
Code: ExtensionError
Message: Operation: Create; Exception: [Status Code: BadRequest; Reason: ]
Inner error:
    AdditionalData:
    date: 2020-11-08T20:40:45
    request-id: 297f7b7d-e2d7-4ad4-8083-cc4797415287
    client-request-id: 297f7b7d-e2d7-4ad4-8083-cc4797415287
ClientRequestId: 297f7b7d-e2d7-4ad4-8083-cc4797415287
Code: UnknownError
Message: The page was not displayed because the request entity is too large.
Inner error:
    AdditionalData:
    date: 2020-11-08T20:35:28
    request-id: b3580f44-dcec-4fdc-87e2-50ae92da8bd3
    client-request-id: b3580f44-dcec-4fdc-87e2-50ae92da8bd3
ClientRequestId: b3580f44-dcec-4fdc-87e2-50ae92da8bd3

有人知道这里出了什么问题吗? 任何信息都会有所帮助。

  • 当我们尝试添加更多订阅时,我们会收到冲突错误“订阅已存在。必须先删除它才能创建另一个订阅”,因为它只支持一个订阅。