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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Retrieve Odata web api using plugin

(0) ShareShare
ReportReport
Posted on by 35

Hello,

im trying to retrieve odata web api using plugin using this code below but its not working. the error is: The remote server returned an error: (401) Unauthorized.

Please advise.

Screen-Shot-2022_2D00_11_2D00_30-at-12.16.19-PM.png

I have the same question (0)
  • Suggested answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    if you query the same instance inside a plugin you can use IOrganizationService, you don't need to use OData.

    If you query another instance then you need to provide the authorization (a bearer token) to connect.

  • Ralph Abou Jaoude Profile Picture
    35 on at

    Can you provide me an example how to provide the authorization to connect ?

  • Suggested answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    in a post I wrote you can find some information on how the authorization works for OData

    https://www.crmanswers.net/2022/01/dataverse-web-api-and-rest-client-vs.html

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Subra Profile Picture

Subra 120

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 92 Super User 2026 Season 1

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 83 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans