Forum Discussion
relkniw
Oct 04, 2022Copper Contributor
MS Graph API: subscribe presence for a large number of user
Hi everybody,
which possibilites do we have to do a perfomant subscribtion the MS Teams presence status for a large number (>5000) of users via the MS Graph API?
Thanks for your help.
Regards
Gerd
5 Replies
Sort By
- Meghana-MSFT
Microsoft
relkniw -
You can create a subscription to receive change notifications when the requested type of changes occur to the specified resource in Microsoft Graph. - https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=http#presence
- relkniwCopper ContributorHi Meghana,
I know that and I use that functionality:
But how many user can I add to "userIsString" in this case?
var sub = new Microsoft.Graph.Subscription
{
ChangeType = "updated",
NotificationUrl = Config.CurrentValue.CallBackUrl + ConfigurationConstants.CallbackSuffixPresenceNotifications,
Resource = $"/communications/presences?$filter=id in {userIdsString}",
//Resource = $"/communications/presences/{pUserId}",
ExpirationDateTime = DateTime.UtcNow.AddMinutes(Config.CurrentValue.PresenceSettings.SubscriptionTimeout),
ClientState = Config.CurrentValue.SecretClientState,
};
var newSubscription = await graphUserClient
.Subscriptions
.Request()
.AddAsync(sub);
Regards
Gerd- Meghana-MSFT
Microsoft
As per the note in https://learn.microsoft.com/en-us/graph/api/cloudcommunications-getpresencesbyuserid?view=graph-rest-1.0&tabs=http#permissions, Maximum of 650 user IDs are supported per API request.