Skip to main content
Solved

Is there any alternative API for Get Events for a Specific Metric API in the new stable revision ?


Forum|alt.badge.img+2

We have a pool of profiles with custom attribute called Tag.

And we need to query metrics, filtered by that attribute. For example, how many Email Opens from the profiles with Tag = ‘ABC’.

As far as we know, we cannot use custom attribute with Query Metric Aggregates API. So the only available approach for us is to retrieve all events of Email Opens metric using legacy API: Get Events for a Specific Metric and perform the filter on our end.

Since v1/v2 legacy APIs are scheduled to be end-of-life on Jan 1, 2024. Is there any alternative API in the new revision ? Or is there any other approach for this requirement?

Best answer by Brian Turcotte

Hi @xhoalee

 

Turns out that the legacy endpoint Get Events for a Specific Metric corresponds to the new Get Events endpoint from the V3 APIs, per our helpful Comparison Chart:

 

 

You can add the metric_id filter to specify “Email Opens” or whatever metric you’re targeting, and then add field[profile] for properties:

 

 

Now you will still have to perform the filter at your end, but the returned records will include profile properties that you can filter from.

 

I hope this helps!

- Brian

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

4 replies

Brian Turcotte
Forum|alt.badge.img+37

Hi @xhoalee!

 

By custom attribute “Tag”, do you mean profile property? If so, let me reach out to Engineering to see if this is possible with the new APIs. I’ll update the thread as soon as I learn more.

 

Best,

Brian


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 2 replies
  • March 2, 2023

Yes, it’s a Custom property.

Thank you.


Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • March 10, 2023

Hi @xhoalee

 

Turns out that the legacy endpoint Get Events for a Specific Metric corresponds to the new Get Events endpoint from the V3 APIs, per our helpful Comparison Chart:

 

 

You can add the metric_id filter to specify “Email Opens” or whatever metric you’re targeting, and then add field[profile] for properties:

 

 

Now you will still have to perform the filter at your end, but the returned records will include profile properties that you can filter from.

 

I hope this helps!

- Brian


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 2 replies
  • March 12, 2023

@Brian Turcotte , tyvm,

We will try the new apis.