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?