Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Getting 401 Unauthorized error while retrieving record using Web API in Dynamics 365 App for Outlook

(0) ShareShare
ReportReport
Posted on by 65

Hi Experts, 

I am trying to retrieve user roles via web api and getting 401 unauthorized error. 

Any ideas on what could be causing this?

Thanks,

Parth Bhaidani

*This post is locked for comments

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,052 on at
    RE: Getting 401 Unauthorized error while retrieving record using Web API in Dynamics 365 App for Outlook

    Hi

    Are you able to run other queries? is it just retrieving role query that fails or all types of queries fail with 401? It looks like the authenticated and authorized client context is not being detected by the API.

    Does the same work on Desktop client?

    I would try and do a WhoAmI and see if that fails

    crmtipoftheday.com/.../passing-enumerated-values-to-web-api

  • Verified answer
    Inogic Profile Picture
    Inogic 438 on at
    RE: Getting 401 Unauthorized error while retrieving record using Web API in Dynamics 365 App for Outlook

    Hi Parth,

    In order to perform CRUD operations while using D365 App for Outlook,  it is recommended that you use the Xrm.WebApi methods.

     

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-webapi

    Thanks!

  • Suggested answer
    Radu Chiribelea Profile Picture
    Radu Chiribelea 6,667 on at
    RE: Getting 401 Unauthorized error while retrieving record using Web API in Dynamics 365 App for Outlook

    Is this CRM Online or OnPremise? If you are using IFD, did you register the application from which you want to retrieve the data?

    Please see docs.microsoft.com/.../walkthrough-register-dynamics-365-app-azure-active-directory for CRM Online

    Here is how you would do it for CRM OnPrem docs.microsoft.com/.../walkthrough-register-app-active-directory

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans