Skip to main content
Business Central forum
Suggested answer

Call the API to get a list of environments

editSubscribe (1) ShareShare
Posted on by 8
Hello. I'm a web developer working on Dynamics 365 Business Central integration.
I have registered a Microsoft Entra application and set up the Microsoft Entra application in Business Central according to this documentation

I received an access token and tested it with a request to the endpoint of the list of companies for the production environment. The request was completed successfully and I received a list of companies.
But when I use the same token to request a list of available environments, I get a 401 response code. To request a list of environments, I use the following endpoint specified in the documentation
GET https:/
I assume that the error is related to the API versions. I have the token for version v2.0. And in the endpoint of the environment list, version 1.1 is indicated.
Could you please tell me if it is possible to get a list of environments for version v2.0 through a request to the API? maybe I'm doing something wrong?
  • Oleh Antykuz Profile Picture
    Oleh Antykuz 8 on at
    Call the API to get a list of environments
    Unfortunately I'm still getting a 401 response code. Even using the admin center API URL that you mentioned. I am attaching screenshots of the application settings and requests in postman. Please tell me what I missed?
  • Oleh Antykuz Profile Picture
    Oleh Antykuz 8 on at
    Call the API to get a list of environments
    Thanks for the links to the documentation and URL
    It looks like I need an additional permission for the application "AdminCenter.ReadWrite.All" which was not previously delegated to the application. I'll test this after the Azure portal admin approves this permission and let you know
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 59,926 Super User on at
  • Suggested answer
    gdrenteria Profile Picture
    gdrenteria 2,706 Super User on at

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…


Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,045 Super User

Martin Dráb Profile Picture

Martin Dráb 222,570 Super User

nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans