Step 1: Create your Web Service Codeunit
In this example it is created a Codeunit with method that returns a
Json array containing Customer’s data, according to a No. and Name filter:
Step 2: Publish your app and publish your Codeunit as a Web Service
Go to the Web Services page and insert a new record with:
1. Object Type = Codeunit;
2. Object ID = Your Codeunit Id;
3. Service Name = Type the service name (example: CustWS);
4. Published = Yes.
Step 3: Obtain the Url to call the Web Service
By definition, an OData base url in Business Central is composed as it follows:
The url is then followed by the service name and the company parameter:
To call an unbound action, in addition to the Service Name, we need to add the method to call, so this is the standard url:
Step 4: Test your Web Service
Using Postman, you can now test your Web Service2.