Solved

How long is a page cursor available for usage - when requesting filtered events from the Klaviyo API?

  • 15 November 2022
  • 4 replies
  • 206 views

Badge +1

Hey dear Klaviyo community, 
As the title of the question suggests, we would like to know, what is the lifespan of a generated next page cursor when sending a request for the events EP? how long does it last? , request example:
https://a.klaviyo.com/api/events?filter=greater-than(datetime,1970-01-01T11:00:00Z)

Thanks!

icon

Best answer by ezra 29 November 2022, 17:24

View original

4 replies

Userlevel 7
Badge +36

Hi @DanielChn and welcome to the Community!

 

When you make a call that gives paginated results, you get the next and prev links. Just to clarify the use case, are you asking if you have to use that next link in a certain time frame before it becomes invalid?

 

If so, I will check with our engineering team to investigate if that time limit exists and get back to the thread. Would you be willing to share more about how this information will be applied to your use case? It may help to understand the basis of the question better.

 

Thanks for using the Community!

 

-Brian

Badge +1

Hey @Brian Turcotte, thanks for the comment

- “Just to clarify the use case, are you asking if you have to use that next link in a certain time frame before it becomes invalid?”
Yes

- “Would you be willing to share more about how this information will be applied to your use case?”
Sure. We want to be able to use the next page cursor, after a period of extended period of time, as we want to store requests that failed in a dlq kind of mechanism, that will be retried and continue from the page that it was stopped. 

Thanks!

Badge +1

Hey @Brian Turcotte, thanks again for the help:), did this reached the relevant developer?

 

Userlevel 1
Badge +1

Hi @DanielChn, thanks for your question and details on your use case!

While we can't provide an exact lifespan, your code should not count on pagination tokens being permanent, and should account for pagination tokens expiring after a period of time. A good rule of thumb here is three days.

Will that timeframe work for your retry mechanism?

Ezra

Reply