From time to time you may notice that you can not locate the record you are looking for in the API. This is because by default the API will only pull 400 records without applying paging.
Paging is a common requirement for applications to expose partial results from larger sets of data i.e. transaction-based collections like JournalTransaction and AccountRegister.
The MYOB Business API default page size is set to 400 however a maximum of 1000 results can be set and returned per page. To do so use the $top filter like so in your call to return page 1 of 1000 records/GeneralLedger/JournalTransaction/?$top=1000
To make pagination easier for you, the JSON response information returned provides paging parameters, including a URINextPageLink
. Calling this URI allows you to retrieve the next set of records. This URI will show you the usage for $top and $skip parameters.
We highly recommend that when used $skip is a multiple of $top for
example/GeneralLedger/JournalTransaction/?$top=500&$skip=500
OData supported Query Strings:
- $orderby - Order results in ascending or descending order, by a specified field.
- $top - Retrieve the first x records in a list.
- $skip - Retrieve all records in a list, except for the first x records.
- $filter - Retrieve all records matching a specified expression.
If you have any questions, feel free to log a ticket with the Customisation & Integration Team.
Comments
0 comments
Article is closed for comments.