Search code examples
microsoft-graph-apiwebhooksmicrosoft-graph-filesmicrosoft-graph-webhooks

Is it possible to get real time update for updates via microsoft graph webhooks?


I am trying to get the updates on SharePoint using MS graph webhooks.

I am using the following API to subscribe

POST https://graph.microsoft.com/v1.0/subscriptions
Content-type: application/json

{
   "changeType": "updated",
   "notificationUrl": "https://<hostname>/api/send/myNotifyClient",
   "resource": "<DocumentLibrary_Identity>",
   "expirationDateTime":"2016-11-20T18:23:45.9356913Z",
   "clientState": "secretClientValue",
   "latestSupportedTlsVersion": "v1_2"
}

I am getting the updates in about 30-40 seconds after the changes are done. For example, if I upload a file or edit a file, the notification for the same is returned after 30-40 seconds.

Is there any way in which I can get the notifications immediately at real-time.


Solution

  • Due to the nature of distributed systems in the cloud, there will always be a delay between a change happening and receiving notification for that change.

    Notifications of changes in Microsoft Graph usually are delivered under a minute after the change happens. If course that can vary depending on services load and usage.

    There's no faster change notification mechanism in Microsoft Graph today. You could imagine polling the get API at a faster frequency but this approach will lead to your application getting throttled in production.