Hi @EmmenNarwhal ,
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.
Steps:
First, you will need to run the Segment API to get the segment IDs and their friendly names, e.g:
{
"content":[
{
"id":"s300000022_591a105ce4b0fc8647cec9ae",
"name":"non-oberon segment",
"description":"non-oberon segment",
"rsid":"obue.analytics.spa",
"owner":{
"id":596983
}
}
],
"totalElements":6,
"firstPage":true,
"numberOfElements":6,
"totalPages":1,
"lastPage":true,
"sort":null,
"size":10,
"number":0
}
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):
{
"rsid":"[Enter RSID]",
"globalFilters":[
{
"type":"dateRange",
"dateRange":"2017-12-31T00:00:00.000/2018-01-06T23:59:59.999"
}
],
"metricContainer":{
"metrics":[
{
"columnId":"0",
"id":"metrics/occurrences",
"filters":[
"0"
]
},
{
"columnId":"1",
"id":"metrics/occurrences",
"filters":[
"1"
]
}
],
"metricFilters":[
{
"id":"0",
"type":"segment",
"segmentId":"[Enter Segment ID here]"
},
{
"id":"1",
"type":"segment",
"segmentId":"[Enter Another Segment ID here]"
}
]
},
"dimension":"variables/[Enter Random eVar]",
"settings":{
"dimensionSort":"asc"
}
}
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.