Qriusity Documentation

API endpoints.

Fetch Questions

/v1/questions

/v1/questions?page=[number]&limit=[number] - fetch Paginated questions sorted in ascending order of created date.

max value of limit is 20. (greater than that is capped to 20)

e.g - /v1/questions?page=2&limit=3 will fetch 3 questions

Try Now

sample output :

[
  {
    "category": {
      "name": "Hip Hop Music",
      "question_count": 0,
      "id": 12,
      "createdAt": "2017-05-24T11:55:21.000Z",
      "updatedAt": "2017-05-24T11:55:21.000Z",
      "parent_category": null
    },
    "question": "In what year did Missy Elliott release her album \"Under Construction\"?",
    "option1": "2009",
    "option2": "2005",
    "option3": "2007",
    "option4": "2002",
    "answers": 4,
    "id": 1024,
    "createdAt": "2017-05-24T11:55:21.000Z",
    "updatedAt": "2017-05-24T11:55:21.000Z"
  },
  {
    "category": {
      "name": "Movie Quotes",
      "question_count": 0,
      "id": 11,
      "createdAt": "2017-05-24T11:55:21.000Z",
      "updatedAt": "2017-05-24T11:55:21.000Z",
      "parent_category": null
    },
    "question": "In what 1954 movie would you hear \"I could've been somebody, instead of a bum, which is what I am.\"",
    "option1": "Hud",
    "option2": "Some Like It Hot",
    "option3": "The Rain",
    "option4": "On The Waterfront",
    "answers": 4,
    "id": 1280,
    "createdAt": "2017-05-24T11:55:21.000Z",
    "updatedAt": "2017-05-24T11:55:21.000Z"
  },
  {
    "category": {
      "name": "Basketball",
      "question_count": 0,
      "id": 1,
      "createdAt": "2017-05-24T11:55:21.000Z",
      "updatedAt": "2017-05-24T11:55:21.000Z",
      "parent_category": null
    },
    "question": "What was the name of the ESPN broadcast in which LeBron James announced he would play for Miami?",
    "option1": "King James",
    "option2": "The Decision",
    "option3": "The Move",
    "option4": "LeBron",
    "answers": 2,
    "id": 1,
    "createdAt": "2017-05-24T11:55:21.000Z",
    "updatedAt": "2017-05-24T11:55:21.000Z"
  }
]

Fetch a Question

/v1/questions/:id

/v1/questions/:id - fetch a particular question. where id is a number.

e.g - /v1/questions/2 will fetch 2nd question

Try Now

sample output :

[
  {
    "category": {
      "name": "Basketball",
      "question_count": 0,
      "id": 1,
      "createdAt": "2017-05-24T11:55:21.000Z",
      "updatedAt": "2017-05-24T11:55:21.000Z",
      "parent_category": null
    },
    "question": "What professional basketball player married and split from Kim Kardashian in 2011?",
    "option1": "William Adams",
    "option2": "Mark Block",
    "option3": "Kris Humphries",
    "option4": "John Williams",
    "answers": 3,
    "id": 2,
    "createdAt": "2017-05-24T11:55:21.000Z",
    "updatedAt": "2017-05-24T11:55:21.000Z"
  }
]

Fetch Categories

/v1/categories

/v1/categories?page=[number]&limit=[number] - fetch Paginated categories sorted in ascending order of created date.

max value of limit is 20. (greater than that is capped to 20)

e.g - /v1/categories?page=2&limit=3 will fetch 3 questions

Try Now

sample output :

[
  {
    "parent_category": null,
    "name": "Action Movies",
    "question_count": 0,
    "id": 4,
    "createdAt": "2017-05-24T11:55:21.000Z",
    "updatedAt": "2017-05-24T11:55:21.000Z"
  },
  {
    "parent_category": null,
    "name": "Chemistry",
    "question_count": 0,
    "id": 5,
    "createdAt": "2017-05-24T11:55:21.000Z",
    "updatedAt": "2017-05-24T11:55:21.000Z"
  },
  {
    "parent_category": null,
    "name": "Bible",
    "question_count": 0,
    "id": 6,
    "createdAt": "2017-05-24T11:55:21.000Z",
    "updatedAt": "2017-05-24T11:55:21.000Z"
  }
]

Fetch Questions corresponding to Categories

/v1/categories/:id/questions

/v1/categories/:id/questions?page=[page]&limit=[limit] - fetch paginated questions corresponding to a particular category. sorted in ascending order of createdAt. where id is a number.

if limit exceeds 20, it will be capped down to 20.

e.g - /v1/categories/2/questions?page=2&limit=3 will fetch all question belonging to category 2, sorted in ascending order of createdAt

Try Now

sample output :

[
  {
    "category": {
      "name": "Animated Movies",
      "question_count": 0,
      "id": 2,
      "createdAt": "2017-05-24T11:55:21.000Z",
      "updatedAt": "2017-05-24T11:55:21.000Z",
      "parent_category": null
    },
    "question": "What singer is the voice of Boo-Boo in the movie \"Yogi Bear\"?",
    "option1": "Kevin Jonas",
    "option2": "Joe Jonas",
    "option3": "Justin Timberlake",
    "option4": "Justin Bieber",
    "answers": 3,
    "id": 4611,
    "createdAt": "2017-05-24T11:55:22.000Z",
    "updatedAt": "2017-05-24T11:55:22.000Z"
  },
  {
    "category": {
      "name": "Animated Movies",
      "question_count": 0,
      "id": 2,
      "createdAt": "2017-05-24T11:55:21.000Z",
      "updatedAt": "2017-05-24T11:55:21.000Z",
      "parent_category": null
    },
    "question": "In \"Rise of the Guardians\" who created Jack Frost by lifting him out of a frozen pond?",
    "option1": "the Man In The Moon",
    "option2": "Nicholas St. North",
    "option3": "The Overlord",
    "option4": "Pitch the Bogeyman",
    "answers": 1,
    "id": 4612,
    "createdAt": "2017-05-24T11:55:22.000Z",
    "updatedAt": "2017-05-24T11:55:22.000Z"
  },
  {
    "category": {
      "name": "Animated Movies",
      "question_count": 0,
      "id": 2,
      "createdAt": "2017-05-24T11:55:21.000Z",
      "updatedAt": "2017-05-24T11:55:21.000Z",
      "parent_category": null
    },
    "question": "Which of these is not one of the guardians in 2012's \"Rise Of The Guardians\"?",
    "option1": "Jack-O-Lantern",
    "option2": "Sandman",
    "option3": "Tooth Fairy",
    "option4": "Easter Bunny",
    "answers": 1,
    "id": 4613,
    "createdAt": "2017-05-24T11:55:22.000Z",
    "updatedAt": "2017-05-24T11:55:22.000Z"
  }
]

Find Categories

/v1/categories/search?name=[name]

/v1/categories/search?name=[name]&page=[page]&limit=[limit] - find Categories where name is a string to search for.

if limit exceeds 20, it will be capped down to 20.

e.g - /v1/categories/search?name=physics&page=1&limit=1 will fetch all question belonging to category 2, sorted in ascending order of createdAt

Try Now

sample output :

[
  {
    "parent_category": null,
    "name": "Physics",
    "question_count": 0,
    "id": 18,
    "createdAt": "2017-05-24T11:55:22.000Z",
    "updatedAt": "2017-05-24T11:55:22.000Z"
  }
]