Skip to main content
Solved

Replacement for v1/v2 "timeline" endpoint in v3?


Digimatic
Partner - Platinum
Forum|alt.badge.img+5

I need to show events for the last X days for a given customer on a separate screen through an integration.  I’m currently using the v1/v2 “timeline” endpoint and it works great, but of course it’s going to be deprecated soon.

I can get all events for a specific profile using getEvents and a filter, but it doesn’t include the metric name.  If I “include” the metric, it just gives me the metric ID, not the name.  The only way I can see to do it at the moment is to make a call to get a list of all metrics first to act as a lookup, but that feels really inefficient and messy given how cleanly it works today with v1/v2.

I thought some combination of “include” and sparse fieldsets would let me pull in the metric name, but it doesn’t seem to work that way, or else I’m doing something wrong.  I can only ever get the ID with includes.

I’ve found posts from 3+ months ago saying a replacement for “timeline” is being worked on, but nothing since.  Am I missing something?  Or do I truly need to just wait for this feature to roll out?  I’m just a bit worried that it will come late in the year and v1/v2 will be deprecated shortly after, giving me a tiny window to make the changes.

Thank you for any guidance here!

Best answer by Brian Turcotte

Hi @Digimatic!

 

The new Get Events when filtered by profile_id is the substitute for the v1 GET /api/v1/metrics/timeline per our Comparison chart and change log here:

 

If you add ?include=metrics you should be able to get the metric name included in the response under the included key.

 

You could also separately get/store all the metric ids and then map the metric names by calling GET /api/metrics, although this would be less a direct method.

 

I hope this helps, and thanks for using the Community!

- Brian

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

2 replies

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

Hi @Digimatic!

 

The new Get Events when filtered by profile_id is the substitute for the v1 GET /api/v1/metrics/timeline per our Comparison chart and change log here:

 

If you add ?include=metrics you should be able to get the metric name included in the response under the included key.

 

You could also separately get/store all the metric ids and then map the metric names by calling GET /api/metrics, although this would be less a direct method.

 

I hope this helps, and thanks for using the Community!

- Brian


Forum|alt.badge.img+3
  • Problem Solver I
  • 34 replies
  • July 22, 2023

Note to others: the “included” field is separate from each data item returned, but matches up.