...
Use the UI to define the query you wish to make programmatic. Press Go to run the query.
When you press GO, the URL in your browser appends a query response identifier, like
r9372
or something similar. Copy the query response identifier to use in the API later.
Note:
...
All measures must be made visible in the UI query to be returned in JSON.
Define a query using BQL
Define a BQL query.
Use the existing endpoint to send BQL instead of the query response identifier.
...