The problem is, I can’t recreate the concurrent viewers metric. Since unlike the other metrics which are using queryBuilder (which are fetch-able using the /analytics/queries/{operation} endpoint), concurrent viewers are fetch-able using metricBuilderonly.
Which endpoint should I use to be able to recreate the concurrent viewers metric?
Thanks before.
the documentation might be a bit misleading as the Max Concurrent Viewers metric is also available via the API but lives under a different API endpoint than the other queries (which is why it’s not available via the QueryBuilder but only via the `MetricsBuilder). But essentially it’s still the same, just under a different API endpoint.
The API you are looking for is the /metrics endpoint that’s under /v1/analytics/metrics/max_concurrent_viewers.
One helpful trick here is to use the Network Explorer in the Browser while using the dashboard as you’ll see what queries / APIs the dashboard is calling while populating the graphs. That way you can easily see what’s going on and translate that to cURL or plain PHP.
The URL is https://api.bitmovin.com/v1/analytics/metrics/max_concurrentviewers with a payload similar to this: