0

Getting Subscription validation failed.Must respond with 200 OK error

I was trying to create a subscription using Microsoft graph API. We have exposed a notification URL which on receiving the post-call from the graph API will respond with the validation token and also status code: 200 OK.

When I tried hitting the subscription API for creating subscription it is showing "Getting Subscription validation failed. Must respond with 200 OK"-error. And At the same time, we are getting Status: 400 Bad request in postman.

Manikandan
  • 11
  • 2

1 Answers1

0

Microsoft Graph validates the notification endpoint provided in the notificationUrl property of the subscription request before creating the subscription.

If validation fails, the request to create the subscription returns a 400 Bad Request error.

Please make sure that you provide a valid notificationUrl in the body. See Notification endpoint validation to see how Microsoft Graph handles the validation process.

Allen Wu
  • 15,529
  • 1
  • 9
  • 20
  • @Manikandan Did you have a chance to look into my answer? – Allen Wu Sep 11 '19 at 03:21
  • .Yes,I did but still getting the same issue.The code for my controller looks like this for accepting response from graph. ``` @RequestMapping(value=”/graphevent”,method= RequestMethod.POST,produces = MediaType.TEXT_PLAIN) Public String getSubscription(@REquestParam(value=”validationToken”,required=false) String validationToken,@RequestBody Optional notification,HttpServletResponce httpResponse){ String response = null; response = service.grtsubscriptions(validationToken,notification,httpResponse) } ``` – Manikandan Sep 17 '19 at 13:58
  • Any update.We have also changed the parameters and saw.The problem is that the graph api is not even reaching our controller.We are getting 400 Bad request.We are having this open item for long time.Could you provide an update. – Manikandan Sep 20 '19 at 06:14