Question

Klaviyo GET-Campaigns API failing when paginating

  • 15 September 2023
  • 3 replies
  • 57 views

Badge

Klaviyo Get Campaigns API failure.

 

I am using the `2023-08-15` of Klaviyo API to get all the campaigns. 

(https://developers.klaviyo.com/en/reference/get_campaigns)

 

I am making paginated requests, using the “next” url in the “links” object. 

At one point, the API is failing with `400` status code & returns

{'errors': [{'id': 'a7fdaa68-1add-4536-91ff-63096728544a',
'status': 400,
'code': 'invalid',
'title': 'Invalid input.',
'detail': "'NoneType' object has no attribute 'tzinfo'",
'source': {'pointer': 'options_static'},
'meta': {}}]
}

 

I am able to get all the campaigns using the deprecated `v1-2` API, so the API keys is fine. 

(https://developers.klaviyo.com/en/v1-2/reference/get-campaigns)

 


3 replies

Userlevel 7
Badge +30

Hi @vaibhavrai2446!

I’m going to check on this with Engineering and I’ll update the thread ASAP!

 

Best,
Brian

Badge

Hi @vaibhavrai2446!

I’m going to check on this with Engineering and I’ll update the thread ASAP!

 

Best,
Brian

 

Hey Brian,

 

Any updates?

Userlevel 7
Badge +30

Hi @vaibhavrai2446!

My apologies for the delay here! 

 

This looks like a case where the 400 is representative of a bad cursor for the next page. Would you be able to provide the exact "next" url that causes a 400 failure? (With any sensitive information - API keys, etc. redacted)

 

This will allow us to gather more insight about the actual source of the error.

 

Best,

Brian

Reply