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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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
Anonymous
Not applicable

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 @Anonymous,

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,name

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

 

 

 

Thanks,

Prashanth Are

MS Fabric community support

nilendraFabric
Super User
Super User

Hi @Anonymous 

 

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

Anonymous
Not applicable

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
FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Fabric Update Carousel

Fabric Monthly Update - March 2026

Check out the March 2026 Fabric update to learn about new features.