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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Issue in get a ODATA API for D365 F&O

(0) ShareShare
ReportReport
Posted on by 76

Hello,

I have followed the instructions to get the access token using oAuth flow and I have an app in AAD.

I am able to get the access token but when I try to hit the OData APIs with that token, it gives me 401 Unauthorized. 

Let me know if there a problem in my scope or it's something else?

I have the same question (0)
  • Suggested answer
    Layan Jwei Profile Picture
    8,118 Super User 2025 Season 2 on at
    Hi Ruchita,
     
    What is common? you need to replace common with the tenantId which you can take from Azure portal
    "https://login.microsoftonline.com/{{tenantId}}/oauth2/token

    and here's what you should fill the body with

    grant_type: client_credentials
    client_id: your client id
    client_secret: your client secret
    resource: your environment url
     
    Also I think you confirmed that your other question is answered, so please verify the answers to help others
    https://community.dynamics.com/forums/thread/details/?threadid=d82b27d1-f88c-ee11-8179-000d3a570dcd
    ​​​​​​​

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Community member Profile Picture
    76 on at
    Hi @Layan Jwei,
     
     
    and I am able to get AccessToken & RefereshToken but when I use to get [BaseURL]/data then it's not working, and I am getting 401 Unauthorized.
     
     
    but when I clicked on verified it's just loading a page a lot and not saved so I will try after some time.
  • Layan Jwei Profile Picture
    8,118 Super User 2025 Season 2 on at
    Hi Ruchita,

    can you then show us what you filled exactly in postman when you called the URL?
    show us the link, body and where u put the token

    Thanks,
    Layan Jweihan
  • Community member Profile Picture
    76 on at
    Hello,
     
    I just set get URL and Token.
     
     
  • Suggested answer
    Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
     
     Did you add permission of read/ write for you App registration?
    You can follow this link in order to add permission to your APP registration:
     
    Regards,
    Waed Ayyad
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
     

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 456 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans