I’m trying to get data via the Dashboard REST API and was able to successfully pull data via the event segmentation endpoint with an event_type and filters. However, for my next chart I need to use a group_by and I’m struggling to properly format the request for my query. Can someone please provide some guidance on how to properly structure complex queries?
For reference, I’m quite confused by the documentation, since it appears there are three different areas where a group_by can be specified.
The first place it mentions is as a parameter next to the event itself:
The second place is as a parameter within the full event:
The third place is as a parameter within the event segmentation section:
Best answer by Saish Redkar
From what I understand, the event segmentation chart end point takes in the following parameters depending on where you want to apply the group by :
- If you want to apply the group by on the actual event ( similar to using group by in the Events Module ) , then you should be including that as part of the event parameter as a key as the documentation mentions ( second place ). Here you can specify either a user property or an event property on that specific event by using type either as “event” or “user”
- If you want to apply the group by across all users ( similar to applying group by in the Segmentation Module) , then you should be including it as a parameter within the event segmentation ( third place ). Here you can input only a valid user property.
I normally create dictionaries in Python to format these requests. Let me know if you need further help with this.
Hope this helps!