Skip to main content
Problem Solver II
February 10, 2023
Solved

"name" filter on get metrics not working

  • February 10, 2023
  • 3 replies
  • 210 views

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?

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

    3 replies

    Irrra
    Expert Problem Solver II
    IrrraAnswer
    Expert Problem Solver II
    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

    Email Marketing Technician at DIDO | iryna@didoagency.com | https://didoagency.com/ |
    rlscsiAuthor
    Problem Solver II
    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
    Expert Problem Solver II
    February 10, 2023

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

    Email Marketing Technician at DIDO | iryna@didoagency.com | https://didoagency.com/ |