Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
pavannarani
Helper III
Helper III

CompanyID is not returning from Business central for BC API Companies

Hello all,

 

 

 

I have multiple companies in the Microsoft Dynamics 365 Business Central environment, so i want to pull all of those company IDs using REST API for automating some processes. So I went through the API documentation of Microsoft to get the companies list with IDs.

GET companies - Business Central | Microsoft Learn

 

In the API response, it's mentioned that it will return the companyId for each company. So I implemented the same using Fabric Data Pipeline, but am not getting the CompanyID from the API response. Is there any reason? I'm using Bearer token authentication only but still am not seeing the CompanyID in api response

 

Pipeline

 

pavannarani_0-1743105060286.png

 

Actual API response coming from data pipeline

 

pavannarani_1-1743105103397.png

 

Expected API Response from Microsoft

 

pavannarani_2-1743105374028.png

 

Is there any other way to pull the CompanyIDs of Business Central companies using Fabric data pipelines. Am i missing anything can anyone suggest me please and help me in resolving it.

 

 

Thanks in advance, any help is really appreciated.

1 ACCEPTED SOLUTION

Hi @nilendraFabric 

 

Thanks, am able to get the CompanyID information from Postman and even with Spark notebooks also, not sure why pipelines is not returning the CompanyID.

 

I implemented the Bearer token authentication approach in notebook and loading the data to fabric lakehouse in config table from there am referencing it for my needs.

 

 

View solution in original post

4 REPLIES 4
pavannarani
Helper III
Helper III

Yes i tried this but still seeing the response like this below even I filtered with id and name also

pavannarani_0-1743158980133.png

 

v-prasare
Community Support
Community Support

Hi @pavannarani,

Thanks for reaching MS FAbric commmunity support.

 

 

Possible Causes:

API Version Difference: The expected API response in the Microsoft documentation includes "id", but your actual response does not. Ensure you're using the latest Business Central API version (v2.0 or higher).

 

Incorrect API Endpoint: Double-check the API endpoint you are using. It should be:

https://api.businesscentral.dynamics.com/v2.0/{tenantId}/production/api/v2.0/companies

Ensure you have replaced {tenantId} with your actual tenant ID.

 

Missing Permissions in Azure AD App Registration: Your Azure AD app may not have the necessary permissions.

Ensure the app has Financials.ReadWrite.All or Financials.Read.All permissions in Azure AD.

 

API Query Parameters: Try adding $select=id,name to your request:

https://api.businesscentral.dynamics.com/v2.0/{tenantId}/production/api/v2.0/companies?$select=id,na...

This ensures only relevant fields (id, name) are retrieved.

 

 

 

Thanks,

Prashanth Are

MS Fabric community support

nilendraFabric
Super User
Super User

Hi @pavannarani 

 

Ensure your Bearer token has adequate permissions by checking the Azure AD app registration and its role assignments in Business Central

 

Use tools like Postman or Power Query to directly test the API endpoint and confirm whether `CompanyID` is returned outside of Fabric Data Pipeline

If the issue persists, consider using Power Query or Spark Notebooks within Fabric to extract data directly from Business Central APIs

Hi @nilendraFabric 

 

Thanks, am able to get the CompanyID information from Postman and even with Spark notebooks also, not sure why pipelines is not returning the CompanyID.

 

I implemented the Bearer token authentication approach in notebook and loading the data to fabric lakehouse in config table from there am referencing it for my needs.

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.