Notifications
Announcements
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
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.
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.
Try this one then https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/troubleshoot-service-authentication
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.
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.
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
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 622 Super User 2025 Season 2
Abhilash Warrier 438 Super User 2025 Season 2
Martin Dráb 354 Most Valuable Professional