API

Games

POST /api/random-games

Creates a "game" of 20 valid canonical clues.

{
  "id": number,
  "clues": [
    {
      "id": number,
      "href": path,
      "answer": string,
      "question": Markdown,
      "value": number,
      "categoryId": number,
      "invalidCount": number,
      "category": {
        "id": number,
        "href": path,
        "title": string,
        "canon": true,
      }
      "canon": true,
    }
  ]
}
    

GET /api/random-games/:id

Returns the "game" of 20 valid canonical clues as specified by the id parameter.

{
  "id": number,
  "clues": [
    {
      "id": number,
      "episodeId": number,
      "aired": string,
      "canon": true
    }
  ]
}
    

GET /api/games

Returns a list of games.

{
  "games": [
    {
      "id": number,
      "episodeId": number,
      "aired": string,
      "canon": true
    }
  ]
}
    

GET /api/games/:id

Returns the details of a game and the ids of its clues.

{
  "id": number,
  "episodeId": number,
  "aired": string,
  "canon": Boolean,
  "clues": [
    {
      "id": number,
      "href": path
    }
  ]
}
    

Categories

GET /api/categories

Returns a list of categories.

{
  "categories": [
    {
      "id": number,
      "title": string,
      "canon": Boolean
    }
  ]
}
    

GET /api/categories/:id

Returns a category with the specified id.

{
  "id": number,
  "title": string,
  "canon": Boolean
}
    

POST /api/categories

Creates a new category.

Send a title

{ "title": string }
    

Returns a category object with an id if it succeeds.

{
  "id": number,
  "title": string,
  "canon": false
}
    

Clues

GET /api/clues

Gets a list of 100 clues.

You can filter by query parameters.

{
  "clues": [
    {
      "id": number,
      "answer": string,
      "question": string | Markdown,
      "value": number,
      "categoryId": number,
      "gameId?": number,
      "invalidCount?": number,
      "category": {
        "id": number,
        "href": path,
        "title": string,
        "canon": Boolean
      },
      "game?": {
        "href": path,
        "aired": string,
        "canon": Boolean
      },
      "canon": Boolean
    }
  ]
}
    

GET /api/clues/:id

Gets the clue specified by id.

{
  "id": number,
  "answer": string,
  "question": string | Markdown,
  "value": number,
  "categoryId": number,
  "gameId?": number,
  "invalidCount?": number,
  "category": {
    "id": number,
    "href": path,
    "title": string,
    "canon": Boolean
  },
  "game?": {
    "href": path,
    "aired": string,
    "canon": Boolean
  },
  "canon": Boolean
}
    

POST /api/clues

Creates a new clue.

Send an answer, question, value, and category id.

{
  "answer": string,
  "question": string,
  "value": number,
  "categoryId": number
}
    

Returns a clue with an id and category object if it succeeds.

{
  "id": number,
  "answer": string,
  "question": string,
  "value": number,
  "categoryId": number,
  "category": {
    "id": number,
    "href": path,
    "title": string,
    "canon": Boolean
  },
  "canon": false
}
    

PUT /api/clues/:id

Updates the specified clue.

Send an answer, question, and value.

{
  "answer": string,
  "question": string,
  "value": number
}
    

Returns the updated clue if it succeeds. It will only succeed if the clue is not canonical.

{
  "id": number,
  "answer": string,
  "question": string,
  "value": number,
  "categoryId": number,
  "invalidCount?": number,
  "category": {
    "id": number,
    "href": path,
    "title": string,
    "canon": Boolean
  },
  "canon": false
}
    

DELETE /api/clues/:id

Increments the invalidCount value by 1, if the clue exists.

Returns the clue.

{
  "id": number,
  "answer": string,
  "question": string | Markdown,
  "value": number,
  "categoryId": number,
  "category": {
    "id": number,
    "href": path,
    "title": string
  },
  "invalidCount"?: number
}
    

GET /api/random-clue(?valid=[true|false])

Returns a random clue. By default, it will only return valid clues.

{
  "id": number,
  "answer": string,
  "question": string | Markdown,
  "value": number,
  "categoryId": number,
  "category": {
    "id": number,
    "href": path,
    "title": string
  },
  "game?": {
    "href": path,
    "aired": string,
    "canon": Boolean
  },
  "invalidCount"?: number
}