MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

Documentation and examples: https://www.mediawiki.org/wiki/API

action=pollny

(main | pollny)
  • This module requires read rights.
  • Source: PollNY
  • License: GPL-2.0+

PollNY API - includes both user and admin functions.

Parameters:
what

What to do?

This parameter is required.
choiceID

Same as clicking the <choiceID>th choice via the GUI; only used when what=vote.

Type: integer
pageName

Title to check for (only used when what=titleExists); should be URL-encoded.

pollID

Poll ID of the poll that is being deleted/updated/voted for.

Type: integer
pageID

Page ID (only used when what=getPollResults).

Type: integer
status

New status of the poll (when what=updateStatus); possible values are 0 (=closed), 1 and 2 (=flagged).

Type: integer
Examples:
Deletes the poll #66
api.php?action=pollny&what=delete&pollID=66 [open in sandbox]
Gets the results of the poll #666
api.php?action=pollny&what=getPollResults&pollID=666 [open in sandbox]
Gets a random poll to which the current user hasn't answered yet
api.php?action=pollny&what=getRandom [open in sandbox]
Checks if there is already a poll with the title "Is PollNY awesome?"
api.php?action=pollny&what=titleExists&pageName=Is%20PollNY%20awesome%3F [open in sandbox]
Sets the status of the poll #47 to 1 (=open); possible status values are 0 (=closed), 1 and 2 (=flagged)
api.php?action=pollny&what=updateStatus&pollID=47&status=1 [open in sandbox]
Votes (answers) the poll #33 with the 4th choice
api.php?action=pollny&what=vote&pollID=33&choiceID=4 [open in sandbox]