Getting Started
API explorer looks and behaves like SQL yet through a few tricks can be formed without any knowledge of this language..
If allowed, the dashboard UI will populate the basic date and licence fields.
The UI will also always attempt TypeAhead - that is, if you begin to type the UI will complete the word or command for you.
My First Query
Log into the bitmovin dashboard UI and select the Analytics dropdown, then API explorer.
Completely erase all the sample content in the box
Type queryBuilder (note how type-ahead fills in the word after the first couple of characters, highlight and click or hit return). There's the option to use the metricsBuilder to query for certain metrics directly: e.g.
max_concurrentviewers
Note how the .licenceKey has automatically been added, this is the licence key for the default analytics licence, use the “Select Licence” menu at the top if you want a different licence key inserted, note how the .licenceKey changes as you select other licences.
Adjust the “Show Metrics Between” menu at the top to your target dates, then hit Apply Date button, note how this inserts the .between dates in the script.
Adjust the “Global Filter” menu at the top to the metrics you are interested in, then hit Apply filters button, note how this inserts the .filter elements in the script.
Now let’s give it an instruction; in a new line write .count(‘PLAY_ATTEMPTS’), again note how typeAhead recommends every word, fills the second quote (note its the quote on the right of the keyboard), and allows selection of the Variable (noting the capitalisation). Also note: In addition to ‘PLAY_ATTEMPTS’ multiple other fields exist see: https://bitmovin.com/docs/analytics/articles/analytics-api-dimensions
Hit Run (it will not work at this point), note how it summarises the query hinting you can add .orderBy or .groupBy instructions similar to the .filters syntax.
Close the query with the .query() line, and you’re done.
- Your script should now have been auto-generated something similar to:
1 queryBuilder2 .between('2020-11-01T00:58:28.454Z', '2020-11-04T00:58:28.454Z')3 .filter('OPERATINGSYSTEM', 'NE', 'Android')4 .licenseKey('….removed....')5 .count('PLAY_ATTEMPTS')6 .query()
- The results should appear in the box below.
Converting APIExplorer into a standalone API call.
Once you are happy with the output to your query press the Copy button, and paste as the PAYLOAD to a RESTful POST request as described here
- Or, open Chrome Inspect’s network monitor, rerun the query, and see the same RESTful POST contained in the list (marked as “count”), right click, extract as cUrl.
Design Limitations
The maximum number of groups from the groupBy instruction is 200 with a cardinality of 10,000 records.
- Various tricks are available to get around these design limitations so please make contact to discuss your needs.
Other methods
Ordering the output ascending: .orderBy('FUNCTION', 'ASC')
Ordering the output descending: .orderBy('FUNCTION', 'DESC')
- Some other examples can be found here