Graph Api Subscription List Empty
Roja Ranjith
25
Reputation points
I am trying to create a presence subscription to listen to any presence changes. However, I do not receive any subscriptionId as response.
After creating a subscription, when I try to get the list using https://graph.microsoft.com/v1.0/subscriptions/, the list is always empty.
Code:
subscription = await client?.api('/subscriptions').post(subscriptionCreationInformation);
// where
subscriptionCreationInformation.changeType = 'updated',
subscriptionCreationInformation.clientState: = 'secretClientState',
subscriptionCreationInformation.latestSupportedTlsVersion = 'v1_2',
subscriptionCreationInformation.resource = `communications/presences/${userId}`;
subscriptionCreationInformation.notificationUrl = `${process.env.NOTIFICATION_URL}/endpoint`;
subscriptionCreationInformation.expirationDateTime = new Date(
Date.now() + 3600000,).toISOString();
I have added the Subscriptions.Read.All permission to my add. I used to receive the subscriptionId earlier but recently not receiving it all the time. Requesting your help with this issue.