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 Companies : Missing Data

(0) ShareShare
ReportReport
Posted on by 20

When calling the following endpoint GET /v2.0/{environment}/api/v2.0/companies (https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_company_get) , not all companies are sent. For example, my user has 5 companies in their Business Central 365 however, the API only returns 2 of them. Why is that case?

Does it have anything to do with permissions of the user or that of the application?

I have the same question (0)
  • Suggested answer
    DAnny3211 Profile Picture
    11,376 on at
    RE: Get Companies : Missing Data

    hello

    but if you run the API in Production you should see them all

    confirm?

    does it only happen to you in sandbox?

    DAniele

  • Suggested answer
    Saurav.Dhyani Profile Picture
    14,358 Super User 2025 Season 2 on at
    RE: Get Companies : Missing Data

    Make sure you are targeting the right environment.

    Returning 2 means its pointing the wrong environment.

  • Suggested answer
    YUN ZHU Profile Picture
    92,770 Super User 2025 Season 2 on at
    RE: Get Companies : Missing Data

    Hi, is it a permission issue? I just tested it and it doesn't look like a problem.

    My test endpoint:

    https://api.businesscentral.dynamics.com/v2.0/d8f36038-1f93-4543-affc-5dc92b6ee871/Sandbox211/api/v2.0/companie

    In BC:

    pastedimage1669336507222v2.png

    In Postman:

    pastedimage1669336473061v1.png

    Hope this helps.

    Thanks.

    ZHU

  • Suggested answer
    DAnny3211 Profile Picture
    11,376 on at
    RE: Get Companies : Missing Data

    hi

    try this URL

    api.businesscentral.dynamics.com/v2.0/{enviroment}/

    api/microsoft/automation/v2.0/automationCompanies

    works 100%

    check my answer if it helped you, thanks

    DAniele

  • AniN Profile Picture
    20 on at
    RE: Get Companies : Missing Data

    Hi Daniele,

    I  check the environment in use - it is `production`.

    1. Do you know if there’s a way to check which environment was used during company creation?

    2. Could you please expand more on differences between “api/v2.0” and “automation/v2.0"?

    I tried “api/microsoft/automation/v2.0/automationCompanies”:

    {

       "error": {

           "code": "Internal_CompanyNotFound",

           "message": "Cannot process the request because the default company cannot be found. You can specify a default company in the service configuration file, or specify one for each tenant, or you can add a query string in the form of \"company=[name]\". You can see the available companies by accessing the default OData web service, Company. For more information, see \"OData Web Services\" in Help.  CorrelationId:  f9526a8a-d8af-4823-a74b-9f0d5c62cb50."

       }

    }

    3. I have tried “/api/microsoft/automation/v2.0/companies”: Only 2 companies of existing 5 were returned
    8015.image-_2800_2_2900_.png

  • AniN Profile Picture
    20 on at
    RE: Get Companies : Missing Data

    I checked the environment and I'm using production, and it matches that of the customer's environment as well. However, we are still seeing 2 companies out of 5.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Get Companies : Missing Data

    Hello,

    Interesting, are you able to logon to these other 3 companies? Have they been initialized successfully since? Otherwise, raise a ticket to Microsoft support so we can assist by looking at the environment.

    Thanks.

  • AniN Profile Picture
    20 on at
    RE: Get Companies : Missing Data

    Hi Marco,

    Yes, the customer is Can you share where can I raise a ticket with Support and the info that I should provide for speedy resolution? Appreciate your help!

    Regards,

    Anindita

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Get Companies : Missing Data

    Hello,

    This is written here:

    learn.microsoft.com/.../manage-technical-support

    Thank you.

  • AniN Profile Picture
    20 on at
    RE: Get Companies : Missing Data

    This is happening in Production.

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