How it works...

To create data using the Business Central API, you create and send a POST request.

You need to be authenticated when making any sort of request against the API. During the development phase, you can use basic authentication and include the username and the web services access keys in order to be authenticated properly.

Remember, in a live environment, you should use AAD for your authentication method.

When creating data, you need to make sure you create it in the correct company. To do that, you need to know the ID of the company, which you can retrieve by calling GET <endpoint>/companies.

Once you have that ID, you need to append it to your requests, like this: POST <endpoint>/companies(<id>)/items.

The field values within the body of your request. Each value you pass will be validated to make sure the data is valid.

When your POST request is completed, the result will contain the record that was created. Any business logic that executes when a record is created and validated will be executed as normal. Any errors in validation will be returned in the request result.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset