Business Central Web Service APIs

Introduction- Business Central Web Service APIs 

Business Central supports multiple web services like API, SOAP, and OData. These are extremely lightweight and easy to use. Because of these services, industry-standard application functionality is available to various external systems and users. We have used these web services to create custom report for clients, handle data in excel or use data in a reporting tool like Power BI.

When Business Central objects are published as web services, they’re immediately available on the network.

In this blog, we will be covering the following topics

  • Understand the existing web services and their use in excel
  • Create any new web service if not available on the list

Finding the right Business Central Web Service APIs

In order to use the web services, navigate to the list of web services available in the system.

Now copy paste the URL as it will include all the details including the company name and allow you to read data from the Business Central System. Note that the web service will be company specific.

In this case, I need to extract the Purchase order line items. So here is the highlighted odata URL for page 54 API.

Graphical user interface, text, application Description automatically generated

  • Open excel > Go to Data > Get Data > Online Services > Dynamics 365 online
  • Or, Data > Other Sources > OData Feed

Graphical user interface, application, table Description automatically generated

  • Update the API link in the pop up which opens up as below

Graphical user interface, application Description automatically generated

It might give you an error as below:

“OData Version: 3 and 4, Error: The remote server returned an error: (400) Bad Request. (Bad Request)”

Graphical user interface, table Description automatically generated

Sometimes, the API either has an issue or it is not published or is not the right API to use. So look for another one.

I found another API page 138 API as below where I am able to get the data loaded after I pasted the API and pressed on “Ok”.

Now, do the same thing in calling these APIs via Power BI Report. To create power BI Report call the Odata service,

It would list down all the companies.

Graphical user interface, application, Word Description automatically generated

  • Select from the standard set of APis the data needed and click on data to start building the report

Graphical user interface, text Description automatically generated

  • Select the right table visual and see the data on the dashboard page.

Graphical user interface, application, Word Description automatically generated

Conclusion- Business Central Web Service APIs

It is always useful to be able to create custom reports for the client even though there are a lot of standard reports available, and I find this feature very handy as I don’t have to keep downloading excel to do my comparison as I connect via APIs and just refresh the data for any new changes.

Business Central comes with an extensive list of built-in APIs that requires no code and minimal setup to use. When using the built-in APIs, please choose the highest API version available. 

You can also develop your own custom APIs using the AL object types API pages and API queries.

 

 

Get In Touch If You Have A Business Query