amplitude-analytics

Amplitude Analytics Dashboard REST API Event object


Using the Amplitude Dashboard REST API, I am attempting to get a count of all unique times a custom event was triggered with a filter of a custom event property. However I am unable to even get the simplest event segmentation to run, though all other endpoint hits (except Funnels which also use the e event parameter) are working as expected. In other words, my auth is working and I'm able to successfully get data from all the endpoints that don't require the e event parameter.

Here is an example of a constructed endpoint using event segmentation that is as simple as I believe it could possible be and which is failing with a 400 error.

https://amplitude.com/api/2/events/segmentation?e=\{"event_type":"_active"\}&start=20170401&end=20170402

While the call I want to do is ultimately more complex and involves a filter, I'm unable to just get this call which is one of the simplest event segmentation calls possible, considering the e, start, and end parameters are all required.


Solution

  • Try properly percent escaping the e parameter.

    https://amplitude.com/api/2/events/segmentation?e=%7B%22event_type%22%3A%22_active%22%7D&start=20170401&end=20170402