How to query the topics_with_no_response.json API with filters

Have a look at Reverse engineer the Discourse API. When I try that approach for the Topics With no Response report, I’m seeing it make GET requests similar to:

http://forum.example.com/admin/reports/bulk?reports%5Btopics_with_no_response%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Btopics_with_no_response%5D%5Bstart_date%5D=2022-02-01&reports%5Btopics_with_no_response%5D%5Bend_date%5D=2023-06-17&reports%5Btopics_with_no_response%5D%5Blimit%5D=50

You can get the encoded query params from the Network tab of your browser’s inspector. With that URL, you should be able to do something like:

curl -X GET "http://localhost:4200/admin/reports/bulk.json?reports%5Btopics_with_no_response%5D%5Bfacets%5D%5B%5D=prev_period&reports%5Btopics_with_no_response%5D%5Bstart_date%5D=2022-05-16&reports%5Btopics_with_no_response%5D%5Bend_date%5D=2022-09-10&reports%5Btopics_with_no_response%5D%5Blimit%5D=50" \
-H "Api-Key: $api_key" \
-H "Api-Username: system"

You will need to set api_key to an All Users Global API key - I don’t think there’s a specific scope that can be used for the reports.

Note that you need to add the json extension to the URL (http://localhost:4200/admin/reports/bulk.json)

1 Like