Solved

Get segmentation rules from dashboard via API

  • 24 April 2023
  • 5 replies
  • 107 views

Hi, I am trying to get the query used to create a segment on a dashboard via API. I have looked at the available endpoints and it does not seem like there is a way to do this, but wanted to confirm!

icon

Best answer by Saish Redkar 27 April 2023, 17:51

View original

5 replies

Userlevel 7
Badge +10

Hi @ksd 

Are you trying to replicate a chart via a API call which uses a user segment? You can replicate your chart’s user segment in your api call using this segment definition construct.
Or do you want to just get results from a existing chart which uses a user segment?

Hi @Saish Redkar

I’d like to get the segment definition used in a chart - I don’t need the results of the segment.

Userlevel 5
Badge +8

@ksd great question, I’m checking with the tech support team. Our API absolutely allows you to retrieve information about the charts and their data (as @Saish Redkar pointed out), but not sure if the API allows you to retrieve the query or segment definition used to create them. Looking into this. 👀

Userlevel 7
Badge +10

If you are looking to pull a segment like this applied to a chart, then I don’t think it’s possible.

You can either query the results of a saved chart using this segment or build this segment definition using the API parameters as shown.

What format are you expecting your segment definition to look like if at all there was a way to extract just that?

Userlevel 5
Badge +8

@Saish Redkar for your help on this. Just posting the final answer from the team that it’s not possible to achieve what @ksd is looking for at this time. 😓

Reply