[object Object] Icon

Learn how to create, start, manage and modify Encodings

[object Object] Icon

Learn how to create, start, manage and modify Players

[object Object] Icon

Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Fri Nov 13 2020

Getting Started with API Explorer

Getting StartedLink Icon

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 QueryLink Icon

  1. Log into the bitmovin dashboard UI and select the Analytics dropdown, then API explorer.

    api explorer menu

  2. Completely erase all the sample content in the box

  3. 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

  4. 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.

  5. 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.

  6. 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.

  7. 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

  8. 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.

  9. Close the query with the .query() line, and you’re done.

  10. Your script should now have been auto-generated something similar to:
1 queryBuilder
2 .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()
  1. The results should appear in the box below.

Converting APIExplorer into a standalone API call.Link Icon

  • 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 LimitationsLink Icon

  • 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 methodsLink Icon

  • Ordering the output ascending: .orderBy('FUNCTION', 'ASC')

  • Ordering the output descending: .orderBy('FUNCTION', 'DESC')

  • Some other examples can be found here

Give us feedback