Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

REST API Guidelines

Adrian Edwards edited this page Feb 22, 2018 · 1 revision

The API is now more like a standard REST API.

The API endpoint has been moved to http://answery.herokuapp.com/api.php


API Guidelines

Since this is now more of a REST API, it should be fairly self-explanatory, so this is just a general overview of what is available. All URL's are using the GET method and are relative to the endpoint above.

Generally, these API endpoints are basically just mix-and-match. They should be able to be requested in any order as long as /questions is first. The API processes them in the following order, if present, regardless of the order they were in when the request was made.

  • questions
  • static or dynamic
  • random.



/questions

This returns a JSON formatted response with every question in Answery's list. This must be included immediately following the endpoint above in all requests.


/static

Adding this to the URL (i.e. GET /questions/static) returns only the "static" questions in Answery's list. i.e. the ones that don't have a different set of answer responses every time (such as short answer, rating, and some multiple choice). This may not be combined with the /dynamic endpoint. Instead, see /questions.


/dynamic

Adding this to the URL (i.e. GET /questions/dynamic) returns only the "dynamic" questions in Answery's list. i.e. the ones that have a different set of answer responses every time (such as colors, cat images, and some multiple choice). This may not be combined with the /static endpoint. Instead, see /questions.


/random

Adding this to the URL (i.e. GET /questions/random) randomly selects and returns a question from the list.



Sample API Requests

GET /questions

GET /questions/static

GET /questions/random

GET /questions/dynamic/random

GET /questions/random/static



API Responses

Please see the OLD Documentation for details on how to interpret the API responses.

Clone this wiki locally