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

Get all company locations via REST API

(2) ShareShare
ReportReport
Posted on by 20
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
  • Suggested answer
    Anton Kheistver Profile Picture
    20 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
  • Suggested answer
    Suresh Kulla Profile Picture
    45,341 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
    YUN ZHU Profile Picture
    78,980 Super User 2025 Season 1 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
  • Sajjad Yousuf Anjum Profile Picture
    70 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.
     
     
  • Anton Kheistver Profile Picture
    20 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.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    9,522 Super User 2025 Season 1 on at

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,025 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,843 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans