There's more...

In this recipe, we retrieved the entire list of items from our company. However, you can also make use of standard REST API filtering syntax in order to pull back only the data you desire. This avoids having to pull a load of data that you don't need.

For our item list example, sending a filtered request could look something like this:

GET endpoint/companies(<id>)/items?$filter=itemCategoryCode eq 'TABLE'

You can read more about filtering guidelines at https://github.com/Microsoft/api-guidelines/blob/master/Guidelines.md#97-filtering.

In addition to filtering your GET requests, you also have the ability to use delta links in your requests. These allow you to only retrieve the changes that have been made to the entity since the initial API call was made.

In order to use delta links, when you make the initial GET request, you need to pass odata.track-changes in the header of the request. By doing this, you can retrieve the delta link from the result.

Once you have the delta link, you can use that in any subsequent call to find out what has changed for the given entity. That's done by passing the deltaToken in the request like this:

GET endpoint/companies(<id>)/items?deltaToken=<deltaLink>

You can read more about using delta links on Microsoft Docs at https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-connect-apps-delta.

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

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