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, the list is always empty.


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( + 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.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,154 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,540 questions
{count} votes