Unable to create a subscription using /subscriptions endpoint

Mahesh Kurucheti 51 Reputation points

Hi Team,

I have gone through the below documentation and trying to create subscription, but getting an error, please find the screenshots below:


The notification URL used is publicly available.User's image

User's image

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,383 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AsithwMSFT 1,420 Reputation points Microsoft Vendor

    @Mahesh Kurucheti

    have you noticed notification URL validation as mentioned in here in your documentation ?

    This error trends to occure due to lack of notification url validation..

    when you create subscription, Microsoft graph validates your notification URL by sending some token such as this

    POST https://{notificationUrl}?validationToken={opaqueTokenCreatedByMicrosoftGraph}

    therefore, you need to separately handle that request from your notification endpoint.

    in this scenario, take the value of validationToken and return it like below.

    if (Request.QueryString["validationToken"] != null)
                    var token = Request.QueryString["validationToken"];
                    return Content(token, "text/plain");

    make sure return content type "text/plan"

    find this samples for more details




    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments