REST API Guidelines
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
ordynamic
-
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.