1

I am using Microsoft webhook change notifications to listen to new emails in user's mailbox. The notifications are subscribed as follows:

{
  "changeType": "created",
  "notificationUrl": "{our-internal-api-endpoint}",
  "resource": "/me/messages",
  "expirationDateTime": "{expiry-time}",
  "clientState": "SecretClientState"
}

As per documentation, the maximum expirationDateTime that can be used for message resource is currentDateTime + 4230 minutes. I have noticed that if I create a subscription using a small expiry time e.g., 60 minutes, I immediately receive a reauthorizationRequired lifecycle notification. Now as per reauthorizationRequired notification's documentation, there are multiple reasons that can can cause this notification and one of them is: "The subscription expires before you renew it".

I suspect that because the subscription is about to expire in short time, Microsoft sends me this notification to signal that I should renew it soon which is why I don't get this notification when I create the subscription with a longer expiry time (i.e. 4230 minutes) and only for lower expiry times like 60 minutes.

Can someone please confirm this behavior because the exact time interval at which Microsoft sends this notification before the subscription expires is not discussed in the documentation.

Marry35
  • 387
  • 4
  • 16

1 Answers1

1

I hope my response isn't coming too late. I can back up what you've noticed: You can safely assume that this is in fact the reason for the reauthorizationRequired Event being triggered. I assume, this is (for now) the only reason you may have to renew your subscription as opposed to simply reauthorizing it. Further more, I suspect this, to being subject to change, perhaps even being supported with a new type of lifecycleEvent in the future.

t0ru
  • 21
  • 2