MADHDA Business Solutions
  • Home
  • About Us
    • Privacy Policy
  • Services
    • Implementations
    • Support
    • Training
    • Upgrade
    • Business Analysis
  • Solutions
    • MS Dynamics 365 Business Central
    • MS Dynamics Nav
    • MS Dynamics 365 Sales/CRM
    • Power BI
    • Power Automation
  • Resources
    • Blog
  • Contact Us
  • How we can create simple OData Web Service?

How we can create simple OData Web Service?

13 August 2021

How we can create simple OData Web Service?

 

Hello all Readers,

 

Why we need web service?

  • In our case we have one custom Entity Employee, in which we are storing the personal information of Employee. Let’s assume that we need to insert the records from the 3rd party application to the Business Central. In this scenario we need to create custom web service as per client requirement.

 

Little bit about OData

  • We can create OData Web Service using two objects Pages and Quires. Main difference between those two Web Services as below.
  • OData web service will give response in json format.
  • Query web services are Read Only, we cannot Create, Update and Delete our data using this web service.
  • In Page web services we can do the CRUD operations (Create, Read, Update and Delete).

 

How we can create simple OData Web Service?

Step 1: We need to create page as Type API, below is the image of mandatory fields which we need to add in page object.



 

 

Step 2: Information of some of the property of page API.

  • Page Publisher: we need to set the publisher of the API endpoint the page is exposed in. Value should have camel cases.
  • API Group: We can set the group of the API endpoint.
  • API Version: We need to set the version of our Web Service example: beta, v1.0 or v2.0.

 

Step 3: Layout part, in which we need to add repeater group and fields which we want to expose in web service.


 

Step 4: Now once we publish our extension in business central, we need to publish our Web Service for that we need to open in Web Service page, after that we need to click on new, in our case we need to add Object Type page, Object ID, and also, we need to add Service Name.

  • Last process is to enable the Published




 

Step 5: Now we need to click on the Web Service URL from OData V4 URL, as we can see in image of Step 4.

  • It will redirect to in new tab. Now if you only want to read data of Business Central otherwise we can copy the web service URL and we need to do other operation in Postman.

 

Step 6: Once you copy the Web Service URL open Postman software to consume/Test our web service.

Get

  • You can download Postman from here: https://www.postman.com/downloads/
  1. In first operation let’s have demo for Get method, paste your Web Service URL into the right side of Get as you can see in below image.
  2. In Authorization you can add your credentials to access the data.
  3. Is the Response area in which we will get the response from Business Central.



 

 

Post

  1. In Post method we need to change the method first from Get to Post.
  2. After that we need to add the Body which we are going to send to Business Central.
  3. Below is the Screen Shot of Postman Request.






Output:



 

  • Hope this will grow your knowledge.

For more details, please visit our website www.madhda.com or contact us on Contact@madhda.com

 

Thanks to all.

 

Previous post: Microsoft Dynamics 365 Business Central: How to use Excel Buffer to Import data With Multiple Sheets?
Next post: How to add Learn more or help link into the fields of page.

Categories

  • Microsoft Dynamics 365
  • Microsoft Dynamics Business central
  • Microsoft Dynamics NAV
  • Uncategorized

Recent Post

  • Business Central : Retrieving Azure AD User information via AL.
    March 20, 2023
  • Change Authentication method from Basic Auth to OAuth2 while accessing Business Central Webservice / APIs.
    February 27, 2023
  • How to use "Dictionary" Object type into Business Central.
    February 17, 2023
  • Post Transaction Using Configuration Package in Business Central.
    February 13, 2023
  • How to Import Image from Excel to BC using Azure function.
    February 6, 2023
 


    © Copyright 2020 | All Rights Reserved By MADHDA