Submit a Joke

Usage

This endpoint is used to programatically submit a joke to be reviewed and added to JokeAPI's official jokes. If you instead just want to manually submit a joke, please click here.

For up to date parmaters on this please check out their documentation

Testing

For testing define dry-run as anything

index.js
await JokeClient.submit({'dry-run': true});

Single Joke

await JokeClient.submit({
  'dry-run': true,
  formatVersion: 3,
  category: 'Misc',
  type: 'single',
  joke: 'testing',
  flags: { nsfw: true, religious: false, political: false, racist: false, sexist: false, explicit: true },
  lang: 'en',
});

Two Part Joke

index.js
const submitDouble = await JokeClient.submit({
  'dry-run': true,
  formatVersion: 3,
  category: 'misc',
  type: 'twopart',
  setup: 'Setup',
  delivery: 'Delivering',
  flags: { nsfw: true, religious: false, political: false, racist: false, sexist: false, explicit: true },
  lang: 'en',
});
Edit this page on GitHub Updated at Mon, Feb 21, 2022