In a support thread titled ‘How could I get voters from a poll?’, Nicolás_Fernández reports an error when calling /polls/voters.json, receiving ‘invalid parameters: poll_name’ despite valid post_id and poll_name. ganncamp suggests using the ‘Export’ button on the poll, which triggers the underlying API call via browser dev tools. Nicolás_Fernández confirms the button is missing, suspecting server configuration. Falco clarifies that the Export button requires the Discourse Data Explorer plugin. Nicolás_Fernández prefers not to install the plugin and considers workarounds. markschmucker attempts to replicate the Export button’s API call (query -16) but receives a 422 error, despite using valid admin credentials. Later, markschmucker shares a working Python script that successfully retrieves poll results via the Data Explorer query, formatting the CSV output for consumption. The solution involves POSTing to /admin/plugins/explorer/queries/-16/run.csv with properly encoded params and headers, including X-Requested-With and Content-Type.
I am having some issue with GET to /polls/voters.json (I need all userNames or IDs that voted each option)
Discourse is always returning me this error:
{
“errors”: [
“You supplied invalid parameters to the request: poll_name”
],
“error_type”: “invalid_parameters”
}
post_id and poll_name are OK because vote and unvote endpoints works fine. It’s just this one
The Export button shows if you have the Discourse Data Explorer plugin installed and working. There are plans to unbundle this eventually, but at the moment there is a dependency.
Query 16 is the built-in poll report. I’ve allowed admins to access this query. @discobot is an admin.
This username and API key work for all other queries. This is my only Data Explorer-based query (which seems like it would be a really powerful tool, BTW).