Skip to main content
Solved

Issue about getting paginated templates

  • February 23, 2023
  • 1 reply
  • 132 views

Forum|alt.badge.img+2

Hello,
I'm trying to get the Klaviyo templates paginated. I set the cursor but in the response only the "links.next" property is populated, "links.prev" is always set on null.

 

The first call is

GET https://a.klaviyo.com/api/templates?sort=-updated

Authorization: Klaviyo-API-Key {{our-api-key}}

revision: 2022-10-17
 

The response is

{

 "data": [

  ...

 ],

 "links": {

  "self": "https://a.klaviyo.com/api/templates?sort=-updated",

  "next": "https://a.klaviyo.com/api/templates?sort=-updated&page%5Bcursor%5D=bmV4dDo6LXVwZGF0ZWQ6OjIwMjItMDctMjUgMTQ6MjQ6MjcrMDA6MDA",

  "prev": null

 }

}

 

The second call is

GET https://a.klaviyo.com/api/templates?sort=-updated&page%5Bcursor%5D=bmV4dDo6LXVwZGF0ZWQ6OjIwMjItMDctMjUgMTQ6MjQ6MjcrMDA6MDA

Authorization: Klaviyo-API-Key {{our-api-key}}

revision: 2023-01-24
 

The response correctly has "next" set on null, but "prev" that should have a link to prev page always set on null

{

 "data": [

  ...

 ],

 "links": {

  "self": "https://a.klaviyo.com/api/templates?sort=-updated&page%5Bcursor%5D=bmV4dDo6LXVwZGF0ZWQ6OjIwMjItMDctMjUgMTQ6MjQ6MjcrMDA6MDA",

  "next": null,

  "prev": null

 }

}

 

Is there any issue about pagination or am I missing something?

 

Thanks in advance

Best answer by Brian Turcotte

@NickAudiens!

 

I haven’t seen this before, so I’m going to run it by Engineering to see if this is a known issue. I’ll get back to you as soon as I know more.

 

- Brian

1 reply

Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • February 24, 2023

@NickAudiens!

 

I haven’t seen this before, so I’m going to run it by Engineering to see if this is a known issue. I’ll get back to you as soon as I know more.

 

- Brian