Skip to main content
Solved

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

  • November 15, 2022
  • 4 replies
  • 264 views

Forum|alt.badge.img+2

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!

Best answer by ezra

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

View original
Did this topic or the replies in the thread help you find an answer to your question?

4 replies

Brian Turcotte
Forum|alt.badge.img+37

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


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 3 replies
  • November 16, 2022

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!


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 3 replies
  • November 23, 2022

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

 


Forum|alt.badge.img+1
  • Klaviyo Employee
  • 4 replies
  • Answer
  • November 29, 2022

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