I am using the graph API to receive change notifications for events. I am able to successfully receive notifications when an event is created, updated or removed.
I have also set up the subscription with a separate url with which to send lifecycle notifications. Validation of the lifecycle notification url is being performed correctly- returning anything other than a 200 results in the subscription not being created.
But- I never actually receive a lifecycle notification beyond that. I have set up subscriptions with expiry dates 15 minutes, 1 hour and 2 hours in the future, and I receive nothing as they approach expiry or when they expire. Changing the password of the subscribed user also does not result in a lifecycle notification.
I have been following this documentation:
https://learn.microsoft.com/en-us/graph/webhooks-lifecycle
https://learn.microsoft.com/en-us/graph/change-notifications-delivery-webhooks?tabs=http#notificationurl-validation
https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=http
A very rough demonstration of what I'm calling to create a subscription:
expiration_time = datetime.now(timezone.utc) + timedelta(minutes=120)
setup_json = {
"changeType": "created, updated, deleted",
"notificationUrl": notification_url,
"lifecycleNotificationUrl": lifecycle_notification_url,
"resource": "me/events",
"expirationDateTime": expiration_time.isoformat(),
"clientState": SOME_CLIENT_STATE,
}
setup_result = requests.post(
"https://graph.microsoft.com/v1.0/subscriptions",
json=setup_json,
headers={"Authorization": f"Bearer {access_token}"},
)
Have other developers been able to successfully receive lifecycle notifications? Is there anything above that appears wrong? Any help would be appreciated!