Help Center / Product Features / Configuration / Can I see a pagination example for Sentry's API?

Can I see a pagination example for Sentry's API?

Pagination in the API is handled via the Link header standard. Here is a pagination example using this API endpoint:

The first HTTP request in this example is GET <> .

This returns 100 events for the issue and has the following link header in the response:

<>; rel="previous"; results="false"; cursor="0:0:1", <>; rel="next"; results="true"; cursor="0:100:0"

One of the URLs in the link response has rel=next. This indicates the next results page, and it also has results=true which means that there are more results.

Based on this, the next request is GET <>.

This request will return the next 100 events for that issue, with again the following link header:

<>; rel="previous"; results="true"; cursor="0:0:1", <>; rel="next"; results="true"; cursor="0:200:0"

The process is repeated until the URL with rel=next has the flag results=false to indicate the last page.

The three values from cursor are: (Cursor Identifier (int, usually just 0), row offset, is_prev (1 or 0) ).

All the help you could dream of

© 2021 • Sentry is a registered Trademark
of Functional Software, Inc.