Views:

Web Service Step by Step


What is Web Service:
XML-based collections of OSP (Open-Source Protocols) and standards used to exchange data between two applications over a network. It’s a quick way to make application data available to any external system and user; Business Central exposes several objects as web services by default and also allows you to create your own.


Types of Web Service Available in Dynamics Business Central:



How to Create New Web Service in Business Central:

Step 1: Use Tell me and search for Web Services.


Step 2: Select Web Service; you will see all pre-published web services.

Step 3: Click ‘New’ to create new web services.


Step 4: Select the Object Type from the drop-down list (we are working with object type ‘Page’).


Step 5: In the object ID field, select the object you want to expose to an external application (Please note those are predefined object IDs available in Dynamics Business Central).
 
In-Service Name column, type the name of the services (please note, you can not use spaces and any other special characters in Service Name, however, you can use underscore if required).



Step 6: Click Publish to get the URL information used in the external application to pull the data from Business Central.


Step 7: Click the Web Service URL and link, and you will get the window to enter your username and password.


Step 8: Go to your user setup in Business Central and look for your username and Web Service Key.

Please note: if you don’t see Web Service Access Key, generate one.

Step 9: User your username and Web Service Access Key for Step 7.

Result: On successful login, you will see the information in the following layout.


How to use Web Service URL in Microsoft Excel.

Step 1: Open Microsoft Excel.

Step 2: Go to Get Data, and select From Other SourcesFrom OData Feed.


Step 3: In the URL type, the Web Service URL from Business Central.

https://api.businesscentral.dynamics.com/v2.0/39718c41-d5ca-46ac-97a8-eea6e5cfaed5/Production/ODataV4/Company('CRONUS%20USA%2C%20Inc.')/GL_Account_List

and click ‘Ok’.


Step 4: On Login windows, Select the  Organizational Account option.


Step 5: Sign in with your Business Central Username and Password.





Step 6: Click Connect.


Step 6: Select Load to load data in Excel sheet.



Result: You will see the entire GL List from your Business Central company in your Excel sheet.