web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Get all company locations via REST API

(2) ShareShare
ReportReport
Posted on by 40
Is there a way to list all company locations using REST API?
 
I tried a few ways:
 
But both return an HTTP 400 error with the text "Resource not found for the segment"
 
That it looks strange for me, because the documentation says that navigation property "locations" should exist on the "company" resource. https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/resources/dynamics_company
I have the same question (0)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    19,160 Super User 2025 Season 2 on at
    Get all company locations via REST API
  • Anton Kheistver Profile Picture
    40 on at
    Get all company locations via REST API
    No, this endpoint returns a single location by its ID. I'm looking for something to get all configured locations for a company.
  • Sajjad Yousuf Anjum Profile Picture
    84 on at
    Get all company locations via REST API
    Hi,
    You can add a Location List Page in Web Service, it will generate the API list which you can use.
     
     
  • Suggested answer
    YUN ZHU Profile Picture
    92,770 Super User 2025 Season 2 on at
    Get all company locations via REST API
    Hi, The standard location API can get all of them, not just one.
    For example,
    https://api.businesscentral.dynamics.com/v2.0/7e47da45-7f7d-448a-bd3d-1f4aa2ec8f62/Sandbox253/api/v2.0/companies(ee335f2f-31d9-ef11-8eec-7c1e524c2aa7)/locations
     
    Thanks.
    ZHU
  • Suggested answer
    Suresh Kulla Profile Picture
    50,233 Super User 2025 Season 2 on at
    Get all company locations via REST API
    Please check the below link for API Endpoint, you need to skip providing the {id} and it will return all the location in the company
     
     
    GET https://{businesscentralPrefix}/api/v2.0/companies({id})/locations({id})
     
  • Suggested answer
    Anton Kheistver Profile Picture
    40 on at
    Get all company locations via REST API
    The root cause was in that that I used MS Graph API to access Business Central. Direct access via https://api.businesscentral.dynamics.com returns all locations as expected

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,330

#2
Sumit Singh Profile Picture

Sumit Singh 2,738

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,546

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans