Skip to main content
Solved

"name" filter on get metrics not working

  • February 10, 2023
  • 3 replies
  • 159 views

Forum|alt.badge.img+3
  • Problem Solver II
  • 11 replies

I have many processes in place and working, including a filter of the profiles, so I understand how those work, but when I try to use the “name” filter on metrics, I get an error that “name is not an allowed filter” for metrics, even though I’m copy/pasting from the Klaviyo API examples.

/api/metrics/?filter=equals%28name%2C%22fubar%22%29

Yields (output is my modified error statement using detail direct from Klaviyo output):

Result is 0|Invalid input.|'name' is not an allowed filter for this resource.

 

Even when I hard-code a real example instead of trying to get an error response I get that message:

        <cfhttp method="get"

                charset="utf-8"

                url=https://a.klaviyo.com/api/metrics/?filter=equals%28name%2C%22Active%20on%20Site%22%29

                result="klaviyoData"

                resolveurl="yes">

            <cfhttpparam type="header" name="Authorization" value="Klaviyo-API-Key #ARGUMENTS.KlaviyoPrivateAPI#">

            <cfhttpparam type="header" name="revision" value="2023-01-24">

            <cfhttpparam type="header" name="Accept" value="application/json">

            <cfhttpparam type="header" name="Content-Type" value="application/json">

        </cfhttp>

        <cfset VAR kResult = deserializejson(klaviyoData.filecontent) />

        <cfif isDefined("kResult.data")>

            <cfset myResult = kResult['data'][1]['id'] />

        <cfelseif isDefined("kResult.errors")>

            <cfset myResult = "0|#kResult['errors'][1]['title']#|#kResult['errors'][1]['detail']#" />

        </cfif>

 

What am I doing wrong?

Best answer by Irrra

Hi @rlscsi !

This may be a bug of the klaviyo itself, contact technical support, they can solve or refer the issue to the klaviyo engineers.

Best, 
Iryna

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

3 replies

Irrra
Expert Problem Solver II
Forum|alt.badge.img+17
  • Expert Problem Solver II
  • 57 replies
  • Answer
  • February 10, 2023

Hi @rlscsi !

This may be a bug of the klaviyo itself, contact technical support, they can solve or refer the issue to the klaviyo engineers.

Best, 
Iryna


Forum|alt.badge.img+3
  • Author
  • Problem Solver II
  • 11 replies
  • February 10, 2023

Thanks - found out they don’t really have filters working for Metrics yet. Best method is to get all metrics and loop through them to find the one you want.


Irrra
Expert Problem Solver II
Forum|alt.badge.img+17
  • Expert Problem Solver II
  • 57 replies
  • February 10, 2023

@rlscsi Have you already contacted technical support with this question?