Solved

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

  • 20 April 2023
  • 2 replies
  • 202 views

Badge +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!

icon

Best answer by Brian Turcotte 21 April 2023, 16:50

View original

2 replies

Userlevel 7
Badge +36

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

Badge +2

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

Reply