Basic
Jokes
These endpoints allow you to retrieve all jokes, a single joke by its id, or a random joke. The response will be an array of JSON objects if you request all jokes, or a single JSON object if you request a single joke or a random joke.
The Joke model
Prop | Type | Default |
---|---|---|
id | integer | - |
type | string | - |
setup | string | - |
punchline | string | - |
All jokes
GET/jokes
Retrieve all jokes.
{
"data": [
{
"id": 1,
"type": "general",
"setup": "What did the fish say when it hit the wall?",
"punchline": "Dam."
},
{
"id": 2,
"type": "general",
"setup": "How do you make a tissue dance?",
"punchline": "You put a little boogie on it."
}
// ...
],
"meta": {
"isFirstPage": true,
"isLastPage": true,
"currentPage": 1,
"previousPage": null,
"nextPage": null,
"pageCount": 1,
"totalCount": 2
}
}
Single joke
GET/jokes/<id>
Retrieve a single joke by its id.
{
"data": {
"id": 1,
"type": "general",
"setup": "What did the fish say when it hit the wall?",
"punchline": "Dam."
},
"meta": {}
}
Random joke
GET/jokes/random
Retrieve a random joke.
{
"data": {
"id": 120,
"type": "general",
"setup": "How do locomotives know where they're going?",
"punchline": "Lots of training"
},
"meta": {}
}