Skip to main content
rollout
Contributor II
Contributor II
November 29, 2022
Solved

GET /metrics + integration.category equals filter

  • November 29, 2022
  • 2 replies
  • 215 views

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!

    This topic has been closed for replies.
    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

    2 replies

    Brian Turcotte
    Klaviyo Alum
    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
    rolloutAuthor
    Contributor II
    December 9, 2022

    Hi Brian,

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

    Ismael