Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Actual API response coming from data pipeline
Expected API Response from Microsoft
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.
Solved! Go to Solution.
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.
Yes i tried this but still seeing the response like this below even I filtered with id and name also
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:
This ensures only relevant fields (id, name) are retrieved.
Thanks,
Prashanth Are
MS Fabric community support
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
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.
User | Count |
---|---|
6 | |
2 | |
2 | |
2 | |
2 |
User | Count |
---|---|
18 | |
17 | |
6 | |
5 | |
4 |