Solved

Events API - specific date range

  • 20 December 2022
  • 4 replies
  • 195 views

Badge +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)

icon

Best answer by jjensen_ksp 20 December 2022, 15:11

View original

4 replies

Userlevel 2
Badge +3

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_

 

Badge +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)

 

Brilliant, thank you! :-)

Badge +1

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

Userlevel 2
Badge +3

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

Reply