Polls

Apiary pollsapi
Help

Apiary Powered Documentation

Sign in with Apiary account.

Polls

Introduction

Polls is a simple web service that allows consumers to view polls and vote in them.

Polls API Root

This resource does not have any attributes. Instead it offers the initial API affordances in the form of the links in the JSON body.

It is recommend to follow the “url” link values or Link headers to get to resources instead of constructing your own URLs to keep your client decoupled from implementation details.

Retrieve the Entry Point

Reference

Question


Resource related to questions in the API.

Question

A Question object has the following attributes.

  • question

  • published_at

  • url

  • choices (an array of Choice objects).

URI Parameters
question_idID of the Question in form of an integer

View a question detail

Choice

URI Parameters
question_idID of the Question in form of an integer
choice_idID of the Choice in form of an integer

Vote on a Choice

This action allows you to vote on a question's choice.

Questions collection

Again, instead of constructing the URLs for the next page. It is highly recommended that you follow the next link header in the response.

URI Parameters
pageThe page of questions to return

List all questions

Create a new question

You can create your own question using this action. It takes a JSON dictionary containing a question and a collection of answers in the form of choices.

  • question (string) - The question

  • choices (array[string]) - A collection of choices.