Paging Tokens

To page through results, or retrieve data updated relative to a given data, Marketo provides paging tokens.

In certain cases long paging token strings may be returned. This may cause you to encounter an HTTP 414 error code. You can find more information on how to handle these errors.

See the Paging Token API documentation.

Token Types

There are two related, but distinct, types of paging tokens which Marketo provides:

  • Date-Based
  • Position-Based

Date-Based

The first is a paging token which represents a date. These are used to retrieve activities, data value changes, and deleted leads which occurred after the date represented by the paging token. This type of paging token is generated by calling the Get Paging Token endpoint and including a datetime.

GET /rest/v1/activities/pagingtoken.json?sinceDatetime=2014-10-06T13:22:17-08:00
{
    "requestId": "1607c#14884f3e74e",
    "success": true,
    "nextPageToken": "GIYDAOBNGEYS2MBWKQYDAORQGA5DAMBOGAYDAKZQGAYDALBQ"
}

The format of the sinceDateTime parameter must conform to ISO 8601 standard date notation. For best results, use a full datetime that includes the time zone. The time zone can be represented as either an offset from GMT using the following format:

yyyy-mm-ddThh:mm:ss+|-hh:mm

Or using a capital “Z” as shorthand to represent UTC like this:

yyyy-mm-ddThh:mm:ssZ

Examples

2016-09-15T15:53:00+05:00

2016-09-15T10:53:00Z

Because sinceDateTime is a query parameter, it must be URL encoded.

The nextPageToken string is then provided to a Get Lead Activities, Get Lead Changes, or Get Deleted Leads call, and activities are retrieved from after the datetime provided to the Get Paging Token API.

GET /rest/v1/activities.json?nextPageToken=GIYDAOBNGEYS2MBWKQYDAORQGA5DAMBOGAYDAKZQGAYDALBQ&activityTypeIds=1&activityTypeIds=12

Position-Based

The second type of paging token may be returned by any batch retrieval call to a Lead Database API. This type of paging token is similar in concept to a database cursor which enables traversal of records. For example, a Get Leads By Filter Type call may represent a set greater than the given batch size, usually the max and default of 300. When there are more results, the moreResult field is true in the response, and a nextPageToken is returned. To retrieve the additional records in the result set, an additional call including nextPageToken with the received value from the previous response in the new call. The resulting response will return the next page in the result set.

recommendation-more-help
bb269a6d-047a-4bf7-9acd-23ad9a63dc59