Pagination
The maximum number of object you can read in a single API request depends on your account configuration. For SuiteProjects Pro production and sandbox accounts, the maximum number of object you can read per request is typically 1,000
. It may be set to a lower value but cannot exceed 1,000
.
You must set the limit
attribute when retrieving a list of objects using the Read
(XML API) or read()
(SOAP API) command to control the number of objects returned. The XML API or SOAP API returns error code 605
if the limit
attribute is not set or exceeds the maximum number of read objects configured for your account. You set the limit
attribute to a lower value to optimize performance.
The limit
attribute lets you read objects in batches by setting a batch size, and an optional offset. Use the limit
attribute and increment the offset to control the response pagination and read objects in consecutive pages of results.
The limit
attribute value must have one of the following formats:
-
One integer number between
1
and1000
– The batch size or maximum number of objects to be returned. -
Two integer numbers separated by a comma
<offset>,<batch_size>
, where:-
<offset>
– A cursor for use in pagination. The response will skip the number of matching objects (or rows) specified using the offset parameter and return the page of objects starting with the next object (or row) in the list. The<offset>
must be a positive number. -
<batch_size>
– A limit on the length of the page. The<batch_size>
must be between1
and1000
.
-
To read objects in consecutive batches, you should set the limit
attribute in the following format <offset>,<batch_size>
where <max_number_of_objects>
is the same for each request and <offset>
is incremented by <batch_size>
starting from 0
with each request, until the request returns no objects or less than <batch_size>
objects. For example, you can use the following values to read object in pages of 500
: "0,500
", "500,500
", "1000,500
", "1500,500
", and so on until the response is empty or contains less than 500 objects.