0

I am currently trying to retrieve Teams presence information via MS Graph API SDK (Beta). Everything is working smoothly when just subscribing for some users. As soon as the number of users gets larger, problems are starting. I hope someone can clarify things:

Basically I am doing it like mentioned here:

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

Issue 1: Two subscriptions, one user/presence on each

After everything was working, I tried to create multiple subscriptions. In my test case two subscriptions with a single contact on each. Trying to create a second subscription does not work with the error "Operation: Create; Exception: [Status Code: Conflict; Reason: A subscription already exists. It must be deleted before a another can be made.]" I am now wondering whether I am doing something wrong or if this is a limitation (haven't found anything in the docs). I hope I am doing something wrong as the goal would be to monitor even more then the 650 users mentioned in the linked article above. The error I get:

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

Issue 2: One subscription, multiple users/presences

Afterwards I tried to create a single subscription with more than my three test users, which sadly did also not work as expected:

  • 250 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
  • 350 Users/presences
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
  • 650 Users/presences
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

Does anyone have an idea what is going wrong here? Any information would be helpful.

hypetsch
  • 125
  • 1
  • 9
  • When you ask for assistance, share the detailed requestid, timestamp, detailederror for analysis; also share whether it's v1.0 or beta endpoint. Sounds to me you're hitting throttling. if its the case try isolate the issue with the smaller numbers and see still you can repro the issue or not or implement best practice for throttling. – Dev Nov 07 '20 at 20:33
  • Thanks @Dev for your reply, I'll provide the information asap. Some thoughts in advance: 1) as mentioned I am using the Beta SDK. You might also know that presence information is yet only available in beta. 2) I am wondering if throttling is the issue as for me the error messages (based on he number of presences I am subscribing - see my initial question) sound more like timeouts and other issues. `Conflict; Reason: A subscription already exists. It must be deleted before a another can be made.` might indicate a limitation of one subscription rather than a throttling issue? – hypetsch Nov 08 '20 at 19:30
  • I edited my question and added the requested information. – hypetsch Nov 08 '20 at 21:17
  • Yes, sounds like a conflict issue, i.e., one subscription is supported. – Dev Nov 09 '20 at 18:50
  • I also get Bad Request when trying to add a subscription with 350 users. – KnuturO Feb 12 '21 at 11:45
  • Hi, back then I also opened an issue on github for these problems but sadly there is no useful update so far: https://github.com/microsoftgraph/msgraph-beta-sdk-dotnet/issues/189 – hypetsch Feb 25 '21 at 20:07

1 Answers1

1
  • When we try to add more subscriptions then we get conflict error "A subscription already exists. It must be deleted before a another can be made", because it supports only one subscription.
Dev
  • 2,428
  • 2
  • 14
  • 15
  • Accepted the answer of @Dev that there is currently only one subscription supported. The other problems seem to be a service issue, see https://github.com/microsoftgraph/msgraph-beta-sdk-dotnet/issues/189 – hypetsch Feb 25 '21 at 20:14