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 :
Small and medium business | Business Central, N...
Suggested Answer

Business Central API grant type "client_credentials" / Oauth2

(0) ShareShare
ReportReport
Posted on by 10

Anyone succeeded in creating a connection to the Business central API (https://docs.microsoft.com/da-dk/dynamics-nav/api-reference/v1.0/

Can see others have issues with it as well:

https://community.dynamics.com/business/f/dynamics-365-business-central-forum/292569/business-central-api---authentication-with-client-id-and-secret/914168#914168

https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb/issues/517

According to this: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow

i should be able to create an auth token i can use on my server that is consuming the Business central API. But i alwaus get "401 Unauthorized" Or "400 Bad Request". 

Can anyone help?

What i've done so far:

  1. registered "Dynamics 365 Business Central" in Azure Active Directory
  2. Added Client secret
  3. Added API permissions for "Application permissions" for "Dynamics 365 Business Central"
  4. Created Request in postman (changed client secret):

postman1.png

postman2.png

What am i doing wrong? Wrong scope? Or maybe wrong setup in AAD?

I really want to avoid using basic auth in production

I have the same question (0)
  • I Gusti Made Ari Profile Picture
    3,600 on at
  • Soeren Frisk Profile Picture
    10 on at

    Sorry the post explains "delegated permissions". Not "application permissions", i'll update my question to make that clearer. Thanks

  • bc-developer Profile Picture
    10 on at
  • Thenerdy Profile Picture
    35 on at

    All if this helps anyone - I was getting something similar and what helped me was to add to the application in Azure - a scope of default without the .


    In the scope section within Postman add the following:
    https://api.businesscentral.dynamics.com/.default

    This fixed the issue for me was able to add a valid token and using it

    Screen-Shot-2022_2D00_11_2D00_05-at-19.28.58.jpg

  • Suggested answer
    DAnny3211 Profile Picture
    11,397 on at
  • Suggested answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at

    Just adding some info.

    Using OAuth to connect Business Central APIs and Web Service in Postman

    https://yzhums.com/20690/

    Hope this helps as well.

    Thanks.

    ZHU

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans