Adds a joke

POST /joke

Adds a joke to the system

Body

Responses

  • item created

    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.

    • thumbsUp integer Required

      Count of upvotes for the joke.

    • thumbsDown integer Required

      Count of down votes for the joke.

    • dateAdded string(date-time) Required
  • invalid input, object invalid

  • an existing item already exists

POST /joke
curl \
 -X POST https://virtserver.swaggerhub.com/dougsillars/joke_api/1.0.0/joke \
 -H "Content-Type: application/json" \
 -d '{"joke":"Knock Knock. Who's there? Hike. Hike Who?","punchline":"I didn't know you liked Japanese poetry.","category":"knockKnock"}'
Request example
{
  "joke": "Knock Knock. Who's there? Hike. Hike Who?",
  "punchline": "I didn't know you liked Japanese poetry.",
  "category": "knockKnock"
}
Request examples
{
  "joke": "Knock Knock. Who's there? Hike. Hike Who?",
  "punchline": "I didn't know you liked Japanese poetry.",
  "category": "knockKnock"
}
Response examples (201)
{
  "id": "ce0b9fbe-7ad8-11eb-9439-0242ac130002",
  "joke": "Why did the chicken cross the road?",
  "punchline": "To get to the other side.",
  "category": "Classic",
  "thumbsUp": 2,
  "thumbsDown": 4,
  "dateAdded": "2016-08-29T09:12:33.001Z"
}
Response examples (201)
{
  "id": "ce0b9fbe-7ad8-11eb-9439-0242ac130002",
  "joke": "Why did the chicken cross the road?",
  "punchline": "To get to the other side.",
  "category": "Classic",
  "thumbsUp": 2,
  "thumbsDown": 4,
  "dateAdded": "2016-08-29T09:12:33.001Z"
}