订阅MS Graph API中的多个用户

问题描述

我目前正在尝试通过MS Graph API SDK (Beta)检索团队的状态信息。订阅一些用户时,一切工作都顺利进行。一旦用户数量增加,问题就会开始。我希望有人可以澄清一下:

基本上,我像提到的here那样做:

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

问题1:两个订阅,每个订阅一个用户/状态

一切正常后,我尝试创建多个订阅。在我的测试案例中,有两个订阅,每个订阅都有一个联系人。尝试创建第二个订阅不适用于错误"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:一项订阅,多个用户/状态

然后,我尝试与三个以上的测试用户创建一个订阅,但遗憾的是,该订阅也无法按预期工作:

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

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

解决方法

  • 当我们尝试添加更多订阅时,会出现冲突错误“一个订阅已存在。必须先删除一个订阅,然后才能进行另一个订阅”,因为它仅支持一个订阅。