Skip to main content
Solved

Events API - specific date range

  • December 20, 2022
  • 4 replies
  • 282 views

Forum|alt.badge.img+3

Hi,

 

I am trying to make this work, but I keep getting ALL events and it seems the filtering doesn’t work…?

 

Please someone explain to me what I am doing wrong and suggest an edit to my HTTP:

https://a.klaviyo.com/api/events/?filter=greater-than(datetime,2022-01-01T11:30:00Z)&filter=less-or-equal(datetime,2022-08-01T11:30:00Z)

 

Brgds Lasse (and merry Christmas)

Best answer by jjensen_ksp

Hi Larindom,

in your example, you have 2 filter attributes that are probably cancelling out one another.

You’re probably looking to use the “and” filter in combination with what you have. In this example I’m using a comma between filters (which implies “and”)

https://a.klaviyo.com/api/events/?filter=greater-than(datetime,2022-01-01T11:30:00Z),less-or-equal(datetime,2022-08-01T11:30:00Z)

 

Reference https://developers.klaviyo.com/en/docs/filtering_

 

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

4 replies

Forum|alt.badge.img+5
  • Problem Solver I
  • 15 replies
  • Answer
  • December 20, 2022

Hi Larindom,

in your example, you have 2 filter attributes that are probably cancelling out one another.

You’re probably looking to use the “and” filter in combination with what you have. In this example I’m using a comma between filters (which implies “and”)

https://a.klaviyo.com/api/events/?filter=greater-than(datetime,2022-01-01T11:30:00Z),less-or-equal(datetime,2022-08-01T11:30:00Z)

 

Reference https://developers.klaviyo.com/en/docs/filtering_

 


Forum|alt.badge.img+3
  • Author
  • Contributor III
  • 5 replies
  • January 6, 2023
larindom wrote:

Hi,

 

I am trying to make this work, but I keep getting ALL events and it seems the filtering doesn’t work…?

 

Please someone explain to me what I am doing wrong and suggest an edit to my HTTP:

https://a.klaviyo.com/api/events/?filter=greater-than(datetime,2022-01-01T11:30:00Z)&filter=less-or-equal(datetime,2022-08-01T11:30:00Z)

 

Brgds Lasse (and merry Christmas)

 

Brilliant, thank you! :-)


Forum|alt.badge.img+2
  • Contributor I
  • 3 replies
  • February 23, 2023

Any solution  for that I’m also facing same issue but  filtering doesn’t work . Any suggest ,how can do specific time for API filtering


Forum|alt.badge.img+5
  • Problem Solver I
  • 15 replies
  • February 23, 2023

@shalukumari , are you filtering events/metrics? Are you trying to filter them by something other than the “datetime” dates?