Fairly new to the Adobe Analytics API and I'm not sure how to go about pulling together some data that I need.
We have a Dimension we've created, which I'll just call 'evar' for now. I need to end up, further down my program, being able to select a segment and get a random selection of 'evar' values from the last 7 days. What I think I need from the API then is a report that will give me either:
all Segments, and for each segment, all values of 'evar' that appear in that segment, or
all values of 'evar', and for each value, all segmentIDs that would contain that value of 'evar'
That way I could cache the result for seven days before needing a new call, and I could retrieve my random set from the full set cache.
The Segments API endpoint doesn't appear to give me what I need, only the list of Segments. If there's a way to get the 'evar' values per segment, then I could actually retrieve the list of 'evar' values as needed and merge them into a cache.
For now though, I have no idea how I would list the 'evar' values and filter them by their related Segments.
To use v2.0 API, other than (multi-)breakdown reports you must specify only one dimension. In this case, each of your random eVars will need a separate request. Though you could have a single request with all segments applied to that eVar.
First, you will need to run the Segment API to get the segment IDs and their friendly names, e.g:
Using these stored segment IDs you can parameterize your Reporting API request either as a global filter or as a metric filter applied to each eVar. E.g. (viewing occurrences from an eVar with two segments applied):
Alternatively, if the eVars are not actually random, you could create events associated to each eVar occurance. Then, other than the Segment API request, you would just need a single Reporting API which returned these events as metrics.
Edit: @jkm-disco beat me to a write up by an hour, forgot to refresh the pa
Old programmer trick, publicly air your struggles and, while you wait, you'll find an answer to your problem. Just make sure you share your answer rather than disappear into the void.
So, apparently what I was looking for was the Report endpoint in the analytics API documented here: https://adobedocs.github.io/analytics-2.0-apis/. I was being thrown of by needing a Metric for the request even though I really don't need it.