Solved

How to pass Segmentation values in Retention API?

  • 25 July 2022
  • 1 reply
  • 154 views

I have been trying to pass the segmentation filters in the retention API on ‘s’ parameter, but I am getting "Unable to create definition from arguments." error as response. We are passing multiple properties in filters as per the document given but it gives an error. Is there any way to pass multiple filters on the segmentation parameter in Retention  API. 

I have been passing the data like this:

[{"prop":"userdata_cohort","op":"is not","values":["xxxyyy"]},{"prop":"New User","op":"greater or equal","values":["1"]}]

The above has been URL encoded and passed as a value for ‘s’ parameter. 

icon

Best answer by Nehita I. 26 July 2022, 14:19

View original

1 reply

Userlevel 3
Badge +5

Hi @vignesh09 ,

This is Nehita from Amplitude Support, thanks for writing in to the Community! Happy to look into this for you. 

Looking at the Dashboard REST API article for the Retention Analysis chart, we can see that ‘userdata_cohort’ is a valid prop for a segment, however ‘New User’ is not. What is this prop supposed to be, as it doesn’t fit the segment definitions? It seems that you will need to change this. 

In addition to that, if you'd like to pull the parameters from a chart so you can replicate the chart using the Dashboard REST API, I'd recommend following these steps:

  1. open up a new tab in chrome
  2. from the chrome menu (the 3 vertical dots on the right side of the address bar) click “More Tools” → “Developer Tools”
  3. Navigate to the “Network” tab in the opened window
  4. enter the search term “dataset” in the search box in the “Network” tab
  5. navigate the new tab page opened in step 1 to the chart in question
  6. click on the resulting “dataset” request that populates in the “Network” tab
  7. once the chart loads, navigate to the “Payload” subtab in that “dataset” request
  8. look for parameters like event_type, etc.

I hope this helps, but please let me know if you have any questions!

Best,

Nehita

 

Reply