BasicJokes

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

PropTypeDefault
id
integer
-
type
string
-
setup
string
-
punchline
string
-

All jokes

GET/jokes

Retrieve all jokes.

Response
{
  "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.

Response
{
  "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.

Response
{
  "data": {
    "id": 120,
    "type": "general",
    "setup": "How do locomotives know where they're going?",
    "punchline": "Lots of training"
  },
  "meta": {}
}