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...
Answered

API call to Companies returns no result / unable to access company

(0) ShareShare
ReportReport
Posted on by 85

Hello Experts,

I have an issue I hope you can help me with. I have an API call to try and get the list of companies in Business Central using an OAUTH2 token.

GET REQUEST from Postman: api.businesscentral.dynamics.com/.../<environment name>/api/v2.0/companies

When I send this request in postman I am getting a 200 OK response which is good, but there are no company values available to me. (the response reads "Value": []) In order to try and solve this issue I was playing around with connecting with Web Service Access Key and I was able to pull a list of production environments, so I thought maybe I could sneak by and enter the company as I already know it and try to access Companies(CompanyID)/customers but I got an error that I do not have access to the company.

I was wondering where I went wrong in setup? I have added my Azure AD app to Business Central in the Azure AD application card, Is it a problem with the user who is accessing the token? Are they unable to reach the company? truthfully, I am cobbling together my knowledge from lots of different MS articles that I have read on the subject and am a little out of my element.

If you can point me in the direction of the problem, and/or additional reading that will help me solve this issue, and get a better understanding of API and Business Central in general that would be much appreciated.

Thanks for your time,

I have the same question (0)
  • Suggested answer
    MahGah Profile Picture
    15,529 on at

    Hi

    Please see this article for OAUTH connection. I followed it before and had sucess https://yzhums.com/20690/

    I think code for company name is something like  api.businesscentral.dynamics.com/.../companies  which is v2.0/ environment  id / environment name  etc. 

    See this article for more info https://yzhums.com/6117/  specifically below section. 

    yzhums.com/.../

  • Verified answer
    YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at

    Hi, It looks like you already have access to BC, but don't have access to all companies.

    Please check, is the Company Name set in the Azure Active Directory Application Card?

    pastedimage1642036758788v2.png

    Hope this will help.

    Thanks.

    ZHU

  • Suggested answer
    James_French Profile Picture
    85 on at

    Hey ZHU, thanks for this. This was 100% the problem. I was SO SURE that this was already correct I never went back to double check. Thanks!

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,229

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans