Votta API reference

« back to overview

Topics [1.0]

index

List all the topics.

URL

GET /topics

Examples

Request (empty request) Response
[
  {
    "id": 3,
    "title": "Favorite Editor",
    "body": "What's your favorite editor?"
  },
  {
    "id": 5,
    "title": "Favorite Cat",
    "body": "What kind of cat do you like most?"
  }
]

show

Show the topic.

URL

GET /topics/:id

Response Object

Examples

Request (empty request) Response
{
  "title": "Favorite Editor",
  "body": "What's your favorite editor?\nThis is important."
}

create

Create a topic to vote for.

URL

POST /topics

Required Parameters

  • topic[title] String

Optional Parameters

  • topic[body] String

Response Object

Examples

Request
topic[title]=Best Restaurant
topic[body]=What's your favorite restaurant?\nDecide it!
Response
{
  "id": 3,
  "title": "Favorite Editor",
  "body": "What's your favorite editor? Come to vote!"
}