How could I get voters from a poll?

Hi team,

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 :frowning:

Dumb question, but don’t you see an ‘Export’ button on the poll itself?

Running the export ought to give you the API call (via your browser’s developer tools)…

6 Likes

Hi @ganncamp, I am not seeing that export button. Maybe should I configure this from server? I didn’t find any config about this.

I found an endpoint that should be returning this info but It’s not working - discourse/polls_controller.rb at main · discourse/discourse · GitHub

What do you get from “Show breakdown”?

1 Like

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.

6 Likes

Thanks everyone for the help! I dont want to install that plugin. Maybe, I will find a workaround with vote and un-vote or something like that :frowning: