GET /joke

By passing in the appropriate options, you can search for available jokes

Query parameters

  • searchString string

    pass an optional search string for looking up inventory

  • numberofJokes integer(int32)

    number of jokes to return

    Minimum value is 1. Default value is 25.

  • category string

    category of jokes to return

    Values are Word game, Classic, School, or KnockKnock.

  • sortBy string

    Values are thumbsUp, thumbsDown, or dateAdded.

  • sortOrder string

    asc is ascending and sorts from A to Z. desc is descending and sorts from Z to A.

    Values are asc or desc.

Responses

  • 200 application/json

    search results matching criteria

    Hide response attributes Show response attributes object
    • id string Required

      The id of the Joke. Assigned when added.

    • joke string Required

      The lead-in to the joke.

    • punchline string Required

      This bit should make you laugh :).

    • category string Required

      the category of the joke.

      Values are Word game, Classic, School, KnockKnock, or French humour.

    • thumbsUp integer Required

      Count of upvotes for the joke.

    • thumbsDown integer Required

      Count of down votes for the joke.

    • dateAdded string(date-time) Required
  • 400

    bad input parameter

GET /joke
curl \
 -X GET https://joke_api.example.com/joke
Response examples (200)
[
  {
    "id": 42,
    "joke": "Teacher: Did your father help you with your homework?",
    "punchline": "Student: No, he did it all by himself.",
    "category": "School",
    "dateAdded": "2015-07-12T20:12:33.001Z",
    "thumbsUp": 6,
    "thumbsDown": 2
  }
]
[
  {
    "id": 42,
    "joke": "What is the name to open the door?",
    "punchline": "Open your chakra",
    "category": "Classic",
    "dateAdded": "1998-07-12T20:12:33.001Z",
    "thumbsUp": 4,
    "thumbsDown": 2
  }
]