In Microsoft Graph API ,to what URL should I send the response containing the validationToken to subscribe to change notifications?

264 views Asked by At

I'm developing a project with webhooks to notify when changes occur in mails. I'm using Zoho Deluge language in the Cliq platform. I am getting the validationToken from the Graph API, when I return it, I am expecting it to accept the validation token and create the subscription, but the API considers it has a new API call and again returns the validationToken. The current URL I'm passing the response to is, "https://graph.microsoft.com/v1.0/subscriptions" What can I do to solve this?

1

There are 1 answers

0
Mehtab Siddique On

Here is an example of the request to send a change notification when the user receives a new mail:

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

{
   "changeType": "created",
   "notificationUrl": "https://webhook.azurewebsites.net/api/send/myNotifyClient",
   "resource": "me/mailFolders('Inbox')/messages",
   "expirationDateTime":"2016-11-20T18:23:45.9356913Z",
   "clientState": "secretClientValue",
   "latestSupportedTlsVersion": "v1_2"
}

For more information:https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=http#request