Skip to main content
Solved

GET /metrics + integration.category equals filter

  • November 29, 2022
  • 2 replies
  • 114 views

rollout
Contributor II
Forum|alt.badge.img+2

Hi there!

 

The documentation for GET /metrics explains that it is possible to use the equals filter on the integration.category property.

 

However the following 

https://a.klaviyo.com/api/metrics/?filter=equals(integration.category,%22API%22)

returns an empty data object array.

 

Without the filter I can see that there are 19 metrics whose attributes.integration.category is “API”.

 

Is there an additional criteria which should also be accounted for when filtering for this?

 

Thanks!

Best answer by Brian Turcotte

Hi@rollout and welcome to the Community!

 

I spoke with our engineering team about this issue, and while we might need a little more time to investigate why you’re receiving an empty array for that call, they did suggest using this endpoint as a workaround, which returns the expected response:

https://a.klaviyo.com/api/metrics/?fields[metric]=name,integration&filter=equals(integration.name,"API")

 

I hope this helps as a start, and thanks for using the Community!

 

- Brian

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

2 replies

Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • November 30, 2022

Hi@rollout and welcome to the Community!

 

I spoke with our engineering team about this issue, and while we might need a little more time to investigate why you’re receiving an empty array for that call, they did suggest using this endpoint as a workaround, which returns the expected response:

https://a.klaviyo.com/api/metrics/?fields[metric]=name,integration&filter=equals(integration.name,"API")

 

I hope this helps as a start, and thanks for using the Community!

 

- Brian


rollout
Contributor II
Forum|alt.badge.img+2
  • Author
  • Contributor II
  • 4 replies
  • December 9, 2022

Hi Brian,

Thanks very much for the updated query - that query works a charm.

Ismael