Managing the returned data
Rows & Pages
Managing the returned data
We protect the API by having a default limit of 500 rows in any response , and a maximum of 1000 rows which can be set as a parameter. To control the amount of data returned in any single API call the user needs to pass rows and page parameters in the call. The API's first response will inform the user how many total rows and total pages are available to fetch (see example below). We suggest your first call uses the default limit of rows=500 and a page=1 parameter. The response to that will include totalrows and totalpages values which you can use for further iterative calls to return more pages of data.
Example (a small rows value is used here purely to keep the illustrative response short — see
above for the recommended real-world default of rows=500):
Example request (OAuth 2.0):
http://<SERVER>/jsonapi/activities.json?company=1&version=6&modelstructure=activitylist&page=1&rows=5
Authorization: Bearer <access_token>
Example request (legacy username/password):
http://<SERVER>/jsonapi/activities.json?company=1&version=6&modelstructure=activitylist&page=1&rows=5&user=<username>&password=<password>
Return data:
{
"responsecode": 1,
"responsestatus": "OK",
"errorcode": 0,
"errormessage": "",
"totalrows": 1600,
"totalpages": 320,
"responsemessage": "",
"pagerows": 5,
"pagenumber": 1,
"success": true,
"synversion": "15.000.0000",
"synapiversion": 6,
"data": [
{
"activityuuid": "F94FF187588D104BBC8A5B96A65365C4",
"activityTimeStampModified": 1652967488,
"activityRecordVersionNumber": 168,
"activityAttachmentCount": "",
"activityCreated": "Created SYN\_Jon on 27/01/2015 at 9:56am"
,etc. etc.
