Skip to main content
Solved

Retention cURL on Dashboard Rest Api

  • April 15, 2021
  • 1 reply
  • 469 views

Hello, I've been trying to get the retention using a starting event and return event.
The cURL that i'm using (excluded the auth header): 

https://amplitude.com/api/2/retention?se=\{"event_type":"ce:notification_open_event"\}&re=\{"event_type":"Start%20Session"\}&start=20210412&end=20210415

notification_open_event is a custom event and i'm trying to use the amplitude default event Start Session as well.

the cURL keeps returning 400: Bad Request (Unable to create definition from arguments)

the documentation (https://developers.amplitude.com/docs/dashboard-rest-api#retention-analysis) states that “Full event for the start action. Supports two "event_type" values: "_new" for new users, and "_active" for all users.”. Can it be a custom event as well? If not, what would be an alternative to do the same but with a custom event

Thanks!

Best answer by jarren.patao

Hi @wayzer,

Looks like you're already on your way to making this REST API call so great work thus far! You are able to use custom events as you've described, but the return event would not actually be queried with "Start%20Session". This event is created with the event type = "session_start" so your query should just alter this string to work appropriately! 

It should look a little like this:

https://amplitude.com/api/2/retention?se=\{"event_type":"ce:notification_open_event"\}&re=\{"event_type":"session_start"\}&start=20210412&end=20210415

Hope this helps!

View original
Did this topic help you find an answer to your question?

1 reply

jarren.patao
Community Manager
  • Technical Support
  • 71 replies
  • Answer
  • April 16, 2021

Hi @wayzer,

Looks like you're already on your way to making this REST API call so great work thus far! You are able to use custom events as you've described, but the return event would not actually be queried with "Start%20Session". This event is created with the event type = "session_start" so your query should just alter this string to work appropriately! 

It should look a little like this:

https://amplitude.com/api/2/retention?se=\{"event_type":"ce:notification_open_event"\}&re=\{"event_type":"session_start"\}&start=20210412&end=20210415

Hope this helps!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings