This page is API documentation for accessing this site programatically. If you would like an API token to create jokes directly, please contact me at contact@mylifeneeds.management.

Requesting an API token does not guarantee that I will give you one.

Joke API Documentation

Successful API Queries

id: The id of the joke in the database.

joke: The content of the joke. Max length is 1900 characters.

category: The joke category. Max length is 32 characters.

Unsuccesful API Queries

data: Any extra data that the error generated.

error: The type of error that occurred.

message: An explanation of why the error occurred.

Retrieving a Joke

/api/joke/[joke_id]

Request method: GET

Retrieves the joke with the joke_id specified and returns in to the requestor.

Endpoint limits: 15 requests per minute.

Retrieving a Random Joke

/api/joke/random/

Request method: GET

Retrieves a random joke from the database.

Endpoint limits: 15 requests per minute.

Retrieving a Page of Jokes

/api/jokes/[page_id]

Request method: GET

Retrieves 20 jokes from the db. The page number passed in will determine which page will be returned. Entries are returned in a JSON list.

Endpoint limits: 5 requests per minute.

Submitting a Joke for Review

/api/joke/submit/

Request method: POST

Creates a joke with both the content and category provided. The data MUST be passed in a form to the endpoint.

The form MUST have both a content field (containing the joke) and a category field (containing the joke category). Content longer than 1900 characters, or categories longer than 32 characters, will be truncated.

Endpoint limits: 100 requests per minute.

Restricted Access Endpoints.

Creating a Joke

/api/joke/create/

Request method: POST

Creates a joke with both the content and category provided. The data MUST be passed in a form to the endpoint.

The form MUST have both a content field (containing the joke) and a category field (containing the joke category). Content longer than 1900 characters, or categories longer than 32 characters, will be truncated.

Endpoint limits: This endpoint requires a valid XAuthToken header to be passed along with the request.

Accepting a Joke Submission

/api/joke/accept/1

Request method: POST

Accepts a joke submission with the ID specified by the joke submission id.

Endpoint limits: This endpoint requires a valid XAuthToken header to be passed along with the request.

Rejecting a Joke Submission

/api/joke/reject/1

Request method: POST

Rejects a joke submission with the ID specified by the joke submission id.

Endpoint limits: This endpoint requires a valid XAuthToken header to be passed along with the request.