Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Integration of odata Api

(0) ShareShare
ReportReport
Posted on by 10

Hi,

I am trying to use the d365 F&O APIs to pull the Data entities data. I have followed the instructions to get the access token using oauth flow. I have an app in azure directory. I am able to get the access token. But when I try to hit the odata APIs with that token, it gives me 401 Unauthorised. I don't know what I have been doing wrong. I followed the instructions but could not get APIs working. Any help would be appreciated.

Let me know if you guys need any other information.

Thanks

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: Integration of odata Api

    Moved to D365 Finance forum.

    I recommend you to check out the Integration Sample app from Microsoft. It has an OData console app sample as well.

    It's a fully functional solution which you can debug and also use as a documentation.

    And you can use it to determine if your problem is in your AAD app registration or in your code (or both).

    github.com/.../Dynamics-AX-Integration

  • Martin Dráb Profile Picture
    232,866 Most Valuable Professional on at
    RE: Integration of odata Api

    I suggest that you don't implement it by yourself at all - use the authentication utility provided by Microsoft as a part of sample integration applications on GitHub.

  • rajatkonigle Profile Picture
    10 on at
    RE: Integration of odata Api

    i have gone through every possible documentation present there, nothing worked. I am not sure why i am getting 00000002-0000-0000-c000-000000000000 in aud. They dont talk about this in the doc you mentioned. How do i inspect what is causing these values in jwt. I followed this to get the token , docs.microsoft.com/.../v1-protocols-oauth-code

    Can you let me know if this is way to get the token to access OData APIs. Or i am using wrong doc to get the token.

  • Suggested answer
    Mea_ Profile Picture
    60,278 on at
  • rajatkonigle Profile Picture
    10 on at
    RE: Integration of odata Api

    I have done everything you mentioned. However when i tries to debug my jwt token, in the "aud" part, i got this {"aud": "00000002-0000-0000-c000-000000000000", ...} which does not seem to be correct, any idea why? also i dont have "upn" in my jwt token info. Maybe the access token is not valid, but not sure why.

  • Suggested answer
    Mea_ Profile Picture
    60,278 on at
    RE: Integration of odata Api

    First of all try to connect via postman docs.microsoft.com/.../third-party-service-test to confirm that settings are correct. IF you cannot, check that you added application id to FnO and mapped to a user, also check that url is correct, somethims you may have trailing slash in the url.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,118 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans