0
votes

I'm trying to setup a MS Graph webhook subscription for messages, but it appears that Graph is sending a blank validationToken. I'm connecting to https://graph.microsoft.com/beta/subscriptions

My API endpoint works in Postman and successfully returns a plaintext response with only the validationtoken, but when I call MS Graph, I get the following error "Subscription validation request failed. Response must exactly match validationToken query parameter". I've also tried both validationtoken and validationToken as the parameter to look for.

Full error message

"{\r\n  \"error\": {\r\n    \"code\": \"InvalidRequest\",\r\n    \"message\": \"Subscription validation request failed. Response must exactly match validationToken query parameter.\",\r\n    \"innerError\": {\r\n      \"request-id\": \"f1546835-606d-4bd8-ab3c-dfb2c75285aa\",\r\n      \"date\": \"2018-08-10T03:45:56\"\r\n    }\r\n  }\r\n}"
1
how you solved this issue. I'm getting same issue.user2754452
Hi mate, can you share how you solved this issueKannan Karmegam

1 Answers

0
votes

To create a subscription you need to expose a notification URL with https (You can look at Graph documentation at https://developer.microsoft.com/en-us/graph/docs/concepts/webhooks).

When you send your create subscription request, the first post message your notification URL will receive is a message with a validation token. You have to send this validation token back. Now you should receive notifications on your specified notification URL. Looking at this failure, it looks like the notification URL is not sending the validation token back.

The response should not vary between Postman and MSGraph. If you are still seeing issues, please share your notification url and we will try to get a repro.