Using pageSize and nextKey

The maximum records that can be fetched in one request is 10,000. If the data present consists of more than 10,000 records, you must use pagination.

The pageSize key allows you to set a value for the number of records per fetch. The resulting nextKey value can then be incorporated into your json data to fetch remaining records. When the nextKey value is returned as zero, all the records have been fetched.

Example Simple Query using pageSize

{
  "name": "My Activities",
  "pageSize":"700",
       "tables": [
                   {
                     "tableName": "TASK",
                     "columns": [
                          "PROJ_ID",
                          "TASK_ID",
                          "TASK_NAME",
                          "TASK_TYPE",
                          "STATUS_CODE",
                          "ACT_START_DATE",
                          "ACT_END_DATE"
                                ]
                    }
                 ]
     
}

		

In the resulting JSON from the above query, if there are no pending results to be fetched, the following values will be displayed:

  • nextTableName: -1
  • nextKey: 0

If there are pending results, then values will be shown as, for example:

  • nextTableName: TASK
  • nextKey: 701.

Include the nextTableName and nextKey properties in your JSON and resend the request to retrieve further data. Repeat the process until nextTableName returns -1 and nextKey returns 0.

Example Simple Query Using nextTableName and nextKey

{
  "name": "My Activities",
  "pageSize":"700",
  "nextTableName": "TASK",
  "nextKey": "701",
       "tables": [
                   {
                     "tableName": "TASK",
                     "columns": [
                          "PROJ_ID",
                          "TASK_ID",
                          "TASK_NAME",
                          "TASK_TYPE",
                          "STATUS_CODE",
                          "ACT_START_DATE",
                          "ACT_END_DATE"
                                ]
                    }
                 ]
     
}