This version features one main endpoint with two parameters (sub-routes).
It'll return a random answer if not used with any parameter. Example:
(GET) /answers
{ "status": "success", "data": { "answer": { "id": 20, "answer": "Don't think about it", "emoji": "👎", "type": "negative" } } }
First parameter of this endpoint is the requested ID. You can request a answer object by specifying its ID number. For example:
(GET) /answers/8
{ "status": "success", "data": { "answer": { "id": 8, "answer": "Reply hazy, try again", "emoji": "🤷", "type": "neutral" } } }
Second parameter is "all". With this, you can request all answers from the API. Example:
(GET) /answers/all
Why don't you try it yourself?
You can also filter out answers by type (?type | ?t), or just request a specific amount of answer objects (?number | ?n).
(GET) /answers/all?t=negative&number=2
{ "status": "success", "data": { "type": "negative", "number": 2, "answers": [ { "id": 17, "answer": "My sources say no", "type": "negative", "emoji": "👎" }, { "id": 15, "answer": "Don't count on it", "type": "negative", "emoji": "👎" } ] } }
There are [ positive | neutral | negative ] types of answers.