Microsoft Graph subscriptions lifecycleUrl not validated

Billy | IKANDA 11 Reputation points
2024-02-20T14:31:12.24+00:00

Hi,

So I have been building an API and I wanted to use subscriptions to listen to the calendar events actively. This seems to work but for some reason, but when I create a subscription delete it and create it again it doesn't try to revalidate the notification URL...
Meaning that if I add a lifecycle URL it doesn't validate that URL either which causes lifecycle notifications not to work.I really want to use lifecycles now to test some things like renewing the subscription etc, but because the lifecycle URL isn't getting validated or used I'm unable to test it properly.

Any idea what I am doing wrong?

Thanks in advance!

EDIT 1:

This is the code I am currently using:

const expirationDateTime = new Date();
expirationDateTime.setDate(expirationDateTime.getDate() + 2);
const client = GraphAuthManager.getAuthenticatedClient(accessToken);
let subscription: Subscription = await client.api(`/subscriptions`).post({
    changetype: "created, updated, deleted",
    notificationUrl: `https://**domainName**/calendars/msgraph/notify-resource`,
    lifecycleNotificationUrl: `https://**domainName**/calendars/msgraph/notify-subscription-lifecycle`,
    resource: `users/${roomIdCalendar}/events`,
    expirationDateTime: expirationDateTime.toISOString(),
});

To me this looks normal but I don't understand why the url is not called anymore.

Any ideas?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,649 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Billy | IKANDA 11 Reputation points
    2024-03-07T15:43:05.7333333+00:00

    No idea but after trying this out every day and not wanting to work it now suddenly works again. No idea what happened...

    0 comments No comments