web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Discovery web API in CRM online return error 401 - Unauthorized

(0) ShareShare
ReportReport
Posted on by 1,738

Hi,

I am facing this issue to get instance data through this API https://disco.crm.dynamics.com/api/discovery/v9.1/Instances but Everytime I hit in Browser or Postman I get this error 

401 - Unauthorized: Access is denied due to invalid credentials.

You do not have permission to view this directory or page using the credentials that you supplied.

Can you guys Help me for this?

Thanks in advance.

I have the same question (0)
  • Verified answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Ajyendra,

    Below is my configuration in AAD and postman environment.

    AAD:

    Set items in screenshot to True:

    2450.JPG

    Add dynamics CRM permission to user, and Grant admin consent for Contoso.

    pastedimage1577862912805v2.png

    (Not sure whether redirect URL is required, but I added it and set it as callback property in my Postman environment)

    Postman:

    Environment settings:

    pastedimage1577863188490v3.png

    I still use OAuth 2.0 and Implicit instead of new NTLM to get access token.

    pastedimage1577863284390v4.png

    It works well to get instance informations after I requested token.

    pastedimage1577863939994v5.png

    Please also ensure that your account has System administrator security role.

    And most important, crm<i> should match to your region, 

    mine is crm5, if I also use crm, then I'll also get 401 error.

    pastedimage1577864230076v6.png

    401:

    pastedimage1577864248016v7.png

    Regards,

    Clofly

  • cloflyMao Profile Picture
    25,210 on at

    In addition,

    -> Run the URL in browser until we have opened D365 admin center from office.com.

    -> It seems that we need to get access token from "https://disco.crm.dynamics.com/" firstly, then we could call "https://globaldisco.crm.dynamics.com/".

    We couldn't call globaldisco directly in browser, it'll always give us an error in JSON format: Authorization has been denied for this request.

    https://community.dynamics.com/365/b/colinvermandermicrosoft/posts/calling-the-dynamics-global-discovery-service

    Regards,

    Clofly

  • ajyendra Profile Picture
    1,738 on at

    Thanks @Clofly.

    ONe more thing What rights we need to access ( I already have two users . one have global admin access and one have service administrator access ) . both are system administrator in CRM

    admin.services.crm8.dynamics.com/.../instances

    403 forbidden error in Postman even I authenticate and generate token still gave me 403 forbidden error.

    Thanks in advance

  • Verified answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Ajyendra,

    (You already have two user roles as required)

    We get Web API access token from organization URL:

    https://crmxxx.crm.dynamics.com

    We get Online Management API access token from Service URL:

    https://admin.services.crm.dynamics.com

    So in postman, we should change auth url to service URL to test .

    pastedimage1577945375457v1.png

    Enter the service URL in browser directly will also gives us 403 forbidden error even if we've logged in CRM. 

    Regards,

    Clofly

  • ajyendra Profile Picture
    1,738 on at

    @cloflyMao   still  giving me same error in postman 403 I just change the discovery url with service url in auth but still same issue in postman

  • cloflyMao Profile Picture
    25,210 on at

    hi

    have you requested a new token based on admin service url?

    pastedimage1577946702593v1.png

  • ajyendra Profile Picture
    1,738 on at

    YEs. If I don't have a Global asdmin or Service Administrator Rights . Can I accessible that data?

    pastedimage1577947016602v1.png

  • Verified answer
    cloflyMao Profile Picture
    25,210 on at
  • ajyendra Profile Picture
    1,738 on at

    Thanks @Clofly I appreciate your help.

  • ajyendra Profile Picture
    1,738 on at

    Hi cloflyMao,

    IT would be great help .

    Can you share the code ? When I tried this with code it gave me error 401 or 403 error .

    Thanks in advance

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans