Page Size and Pagination

Page Size

Page size enables you to specify the number of rows from 1 to 10000 in a request to limit the number of rows in a response. Invalid values or values out of the specified range are discarded and the default value of 10000 is used.

For example:

{
  "name": "My Activities",
  "sinceDate": "2001-11-15 14:27:49 -0500",
  "pageSize": "5",
  "tables": [...]
}

Pagination

Pagination enables you to organize the content of large responses into smaller, more manageable chunks. The response contains pagination information to indicate that there is data in the response that has not been returned. You can send the same request again along with the pagination information to get the rest of the data.

For example, the following response contains pagination information:

       "pagination": [
            {
                "nextTableName": "TASK",
                "nextKey": "1139"
            }
        ]
 

To retrieve the rest of the data from the original query, you can set the "nextTableName" and "nextKey" properties in the original request object and run the query again. The response will return the rest of the data for the same query, up to number of rows specified in "pageSize" property. If there is more data, the response will include a new section of pagination information. You can continue to send requests with new pagination information until the no "pagination" section in the response JSON text or the "nextTableName" is "-1".

Sample response with pagination data

{
    "data": {
        "TASK": [
            ...
                  ,
            {
                "TASK_NAME": "1A Charging Pump: Hang Clearance",
                "PROJ_ID": "4516",
                "STATUS_CODE": "TK_NotStart",
                "TASK_TYPE": "TT_Task"
            }
        ],
        "pagination": [
            {
                "nextTableName": "TASK",
                "nextKey": "6"
            }
        ],
        "safetyDate": [
            {
                "queryName": "Test",
                "sinceDate": null
            }
        ]
    }
}
 

Sample request for next page

{
 "name": "Test",
 "sinceDate": null,
 "pageSize": "5",
 "nextTableName":"TASK",
 "nextKey":"6",
 "tables": [
   {
     "tableName": "TASK",
     "columns": [
       "TASK_NAME",
       "PROJ_ID",
       "STATUS_CODE",
       "TASK_TYPE"
     ]
   }
 ]
}