Few things to check here -
- Try isolating the code and use Postman/Graph Explorer to call same API and observe results.
- Do note notificationUrl must be capable of responding to the validation request. Also, you need to make sure that the validation token returns as plain/text. Please refer to the Notification endpoint validation document for details.
- Other requirements(from the same reference):
response within 10 seconds
200 (OK) status code.
content type must be text/plain.
body must include the validation token.- Code Samples
ASP.NET MVC Sample - Specifically look at the NotificationController.cs file
public async Task<ActionResult> Listen()
{// Validate the new subscription by sending the token back to Microsoft Graph. // This response is required for each subscription. if (Request.QueryString["validationToken"] != null) { var token = Request.QueryString["validationToken"]; return Content(token, "plain/text"); }
- Code Samples
Please upvote if this helps. Thanks!