Documentation

Pagination

For REST inputs, a critical requirement is being able to specify the pagination for data being read. Because you're typically pulling in large amounts of data, you need a way to spread that data out over multiple "pages" or "sections" and keeping track of where each page or section ends is crucial.

Alooma's REST input integration supports four types of pagination: Simple, Incremental, Sessioned, and Cursor.

  • Simple: Every request includes which page the request is for, and every response includes the next page's identifier (if another page exists).

  • Incremental: Every request includes which page number the request is for, and subsequent requests are for the next page, incrementally.

  • Sessioned: Every request includes the ID of the session, and subsequent requests are for the next page, incrementally.

  • Cursor: Every request includes the ID of the last object retrieved in the previous request.

Note

If you leave the pagination fields blank when configuring pagination in your REST input, the pagination type will be set to None, regardless of whether a pagination type is selected.

Simple

Incremental

Sessioned

Cursor

Next page indicated in response?

Yes

No

Yes

No

Parameters to be specified in input configuration

2 (next_page, page)

up to 3:

page (mandatory)

increment (optional)

initial_value (optional, API only)

2 (next_id, id)

3 (has_more, object_id, starting_after)

End of iteration

when no more 'next_page'

when no more events in response

when no more 'next_id' in response

when 'has_more'=false

Managing what should be retrieved next

Alooma manages by asking for the next_page in response

Alooma manages by incrementing according to user specifications

remote server manages by the next_id parameter

Alooma manages by asking for objects starting after the last object read

Common examples

Salesloft

Shopify

 

Stripe

Simple Pagination Example

Here's an example of simple pagination, given the following snippet from the REST API response.

If the JSON response body contains something like:

"next_page": 3

then:

"next_page" would go into Next Result Key, as this is the parameter that contains the value to include in the request for the next page.

"page" would go into Page Parameter, as this is where we need to set the value for the next page in the subsequent request. And so the next request URL would look something like this:

https://some.url.com/api/v2/articles.json?page=3

Search results

    No results found