Reputation: 99
I have been trying to subscribe users presence to Microsoft graph api by using Microsoft graph beta sdk. I am able to subscribe one user successfully and also works fine like when i change status from Microsoft teams it changes as expected.
When I try to subscribe another user it says subscription already exist. try deleting one to add another.
Is there any way to subscribe all users at once or i need to loop some other way around?
code :
var subscription = new Subscription
{
ChangeType = "updated",
NotificationUrl = _applicationBaseUrl + "/Platform/presenceNotification",
Resource = $"/communications/presences/{id}",
ExpirationDateTime = DateTime.UtcNow.AddMinutes(2),
ClientState = tenantId
};
await graphClient.Subscriptions
.Request()
.AddAsync(subscription);
Upvotes: 3
Views: 600
Reputation: 46
Yes you can ask for multiple ids, and you must write each ID in the request, MS is limiting you to a list of maximum 650 users.
The resource format is:
"/communications/presences?$filter=id in ('id1','id2',...)";
Upvotes: 3