How to get event and segment name for data tables using REST API

  • 21 November 2022
  • 2 replies
  • 151 views

I’m using this dashboard REST API to export a data table. The endpoint returns the values and the row labels but not the column labels (ie. the event names and segment names). It instead contains a 'valuesMetadata' entry that’s a list of objects with ‘metricIndex’, ‘segmentIndex’ which have integer values 0, 1, …
Is there a way to get the metric name and segment name from these indexes. The indexes don’t seem related to any global ID as they always start from 0 irrespective of the events chosen in the data table.


2 replies

Userlevel 4
Badge +7

Hey,

thank you for your patience! I just got an update on this: 

 

Hi @zhenia , metricIndex, segmentIndex corresponds to the index of the metric, segment in the table, respectively:

 

Screen Shot 2022-12-13 at 4.32.54 AM

Hope this helps! 

 

Best,

Zhenia

 

 

Thanks for the update Zhenia. I understand that the index are in the same order as seen in the table/chart, but is there a way to get these names through the API? Given a chart ID the API returns the data inside the table but there’s no way of programatically finding the event and segment names - the table headers.
Is there any other API I can use to get the names “All Users”, “United States”, “Any Event”, “New User”, “Any Active Event”?

Reply