I provided the following query definition
{
"view": "history",
"fields": [
"user.name",
"history.approximate_usage_in_minutes",
"history.query_run_count",
"user.id"
],
"pivots": null,
"fill_fields": null,
"filters": {
"history.is_single_query": "Yes",
"history.completed_date": "7 days",
"user_facts.is_looker_employee": "No"
},
"filter_expression": null,
"sorts": [ "history.approximate_usage_in_minutes desc" ],
"limit": "10",
"column_limit": null,
"total": null,
"row_total": null,
"subtotals": null,
"vis_config": {
"show_view_names": true,
"show_row_numbers": true,
"show_view_names": true,
"show_row_numbers": true,
"truncate_text": true,
"size_to_fit": true,
"table_theme": "white",
"type": "looker_grid",
"series_labels": {
"user.name": "Name",
"history.approximate_usage_in_minutes": "Minutes",
"history.query_run_count": "Queries",
"percent_under_10s": "% Queries Under 10s"
},
"note_state": "collapsed",
"note_display": "hover",
"note_text": "Top users by approximate minutes used and query count in the last 7 days.",
"defaults_version": 1
},
"filter_config": {
"history.is_single_query": [
{
"type": "is",
"values": [ { "constant": "Yes" }, { } ],
"id": 0,
"error": false
}
],
"history.completed_date": [
{
"type": "past",
"values": [ { "constant": "7", "unit": "day" }, { } ],
"id": 1,
"error": false
}
],
"user_facts.is_looker_employee": [
{
"type": "is",
"values": [ { "constant": "No" }, { } ],
"id": 2,
"error": false
}
]
},
"model": "system__activity",
"dynamic_fields": "[{\"table_calculation\":\"percent_under_10s\",\"label\":\"Percent Under 10s\",\"expression\":\"${history.queries_under_10s} / ${history.query_run_count}\",\"value_format\":null,\"value_format_name\":\"percent_0\",\"_kind_hint\":\"measure\",\"_type_hint\":\"number\",\"is_disabled\":true}]"
}
to the “Run Inline Query” API endpoint https://developers.looker.com/api/explorer/4.0/methods/Query/run_inline_query and it works fine.
The easy way to get the query definition is to open the built in system activity dashboard, then choose “Explore From Here” to start exploring. Then save the explore as a Look. Now use the “Get Look” API endpoint to retrieve the json representation of the Look. That will contain the JSON representation of the query. You can use that JSON or modify it then use it with the run_inline_query API endpoint.