Download OpenAPI specification:
Pelican users api
Register the user in with an email and password
Registration data
string | |
| name | string free text user name |
| password | string the password |
| c_password | string a repeat of the password |
{- "email": "spmcquizz@example.ca",
- "name": "Seanathan P. McQuizz",
- "password": "<redacted>",
- "c_password": "<redacted>"
}{- "data": {
- "token": "<redacted>",
- "name": "Seanathan P. McQuizz",
- "email": "spmcquizz@example.ca",
- "uuid": "67d3084426bb0"
}
}Log the user in with an email and password
Login data
string | |
| password | string |
{- "email": "user@example.ca",
- "password": "<redacted>"
}{- "data": {
- "token": "<redacted>",
- "name": "Seanathan P. McQuizz",
- "email": "spmcquizz@example.ca",
- "uuid": "67d3084426bb0"
}
}Gets the url for redirecting for google oauth authorization.
Logging in via oauth is a three step process:urlurlauthenticate endpoint: The user's browser will be redirect again back to the front end with a code value in the query string. Call the authenticate endpoint with code on the query string.401.Post the code from Google to log the user in.
urlurlauthenticate endpoint: The user's browser will be redirect again back to the front end with a code value in the query string. Call the authenticate endpoint with code on the query string.401.{- "data": {
- "token": "<redacted>",
- "name": "Seanathan P. McQuizz",
- "email": "spmcquizz@example.ca",
- "uuid": "67d3084426bb0"
}
}{- "data": {
- "uuid": "67c8746bc1256",
- "name": "Seanathan P. McQuizz",
- "email": "spmcq@example.ca",
- "elo": 1200,
- "current_streak": 4,
- "longest_streak": 23,
- "role": {
- "id": 2,
- "name": "Normal User",
- "description": "Normal User"
}, - "football": {
- "current_yardline": 40,
- "total_yards": 900,
- "total_complete": 12
}, - "badges": [
- {
- "name": "First Question Correct",
- "description": "First Question Correct",
}
]
}
}{- "data": {
- "start_date": "2025-03-01 12:34:56",
- "end_date": "2025-03-01 12:34:56",
- "total_responses": 18,
- "total_responses_correct": 9,
- "highest_user_elo": 1410,
- "lowest_user_elo": 980,
- "current_user_elo": 1280,
- "highest_correct_elo": 1740,
- "current_streak": 4,
- "longest_streak": 8,
- "ratio": 50
}
}Returns one question and it's associated HATEOAS links by its id.
Any question can be in one of two formats: 'text' or 'img'.hash can be tested. The hashing formula is md5(salt+option_id) where the salt is the pre-determined value. For implementations where 'cheating' is of consequence, the hash functionality may be removed. operationId: getQuestion
| id required | integer >= 1 The id of the question |
{- "data": {
- "id": 100,
- "text": "What is Saskatchewan?",
- "image_url": "string",
- "caption": "string",
- "source": "string",
- "format": "text",
- "elo": 1000,
- "rating": "Easy",
- "hash": "string",
- "options": [
- {
- "id": "f504712b-e173-4af6-86f9-58b4993392b0",
- "text": "Saskatchewan",
- "caption": "A square",
- "format": "text",
- "links": {
}
}
], - "tags": [
- {
- "id": 6,
- "name": "Sports"
}
]
}
}Returns a set of questions for a given tag id.
The number of questions in the set is determined bycount passed on the query string. count is less than 10, 10 is usedcount is greater than 50, 50 is usedhash can be tested. The hashing formula is md5(salt+option_id) where the salt is the pre-determined value. For implementations where 'cheating' is of consequence, the hash functionality may be removed. operationId: getSetByTag
| count required | integer [ 1 .. 50 ] Example: 2 The count of questions |
| id required | integer >= 1 Example: 2 The id of the tag |
{- "data": [
- {
- "id": 100,
- "text": "What is Saskatchewan?",
- "image_url": "string",
- "caption": "string",
- "source": "string",
- "format": "text",
- "elo": 1000,
- "rating": "Easy",
- "hash": "string",
- "options": [
- {
- "id": "f504712b-e173-4af6-86f9-58b4993392b0",
- "text": "Saskatchewan",
- "caption": "A square",
- "format": "text",
- "links": {
}
}
], - "tags": [
- {
- "id": 6,
- "name": "Sports"
}
]
}
]
}Returns a set of questions by a list of tags.
The tag list is a csv string of tag ids, ie '3,9,12'. The number of questions to return is thecount. The count of questions requested must be at least three times larger than the number of tags in the tag list. ie. if the tags requested are '2,17,5' (three tags in total), then the count of questions must be at least 9. The number of questions from each tag is proportionally balanced. For example, if the tags requested are '2,7' and tag 2 has 800 questions and tag 7 has 200 questions, then the question set returned will have four times as many questions from tag 2 as from tag 7. This prevents questions from tags that have smaller number of total questions from being overweighted. count is less than 10, 10 is usedcount is greater than 50, 50 is usedhash can be tested. The hashing formula is md5(salt+option_id) where the salt is the pre-determined value. For implementations where 'cheating' is of consequence, the hash functionality may be removed. operationId: getSetByTag
| count required | integer [ 1 .. 50 ] Example: 10 The count of questions |
| ids required | string Example: 2,15,7 The id string of the tags |
{- "data": [
- {
- "id": 100,
- "text": "What is Saskatchewan?",
- "image_url": "string",
- "caption": "string",
- "source": "string",
- "format": "text",
- "elo": 1000,
- "rating": "Easy",
- "hash": "string",
- "options": [
- {
- "id": "f504712b-e173-4af6-86f9-58b4993392b0",
- "text": "Saskatchewan",
- "caption": "A square",
- "format": "text",
- "links": {
}
}
], - "tags": [
- {
- "id": 6,
- "name": "Sports"
}
]
}
]
}Submits one basic resonse to a question.
| id required | integer >= 1 The id of the questions |
| uuid required | string The uuid of the option |
{- "data": {
- "is_correct": true,
- "additional_facts": "Some optional facts about the trivia",
- "stats": {
- "correct": 9,
- "incorrect": 3,
- "percentage_correct": 75
}
}
}Submits one timeout resonse to a question.
| id required | integer >= 1 The id of the questions |
{- "data": {
- "is_correct": true,
- "additional_facts": "Some optional facts about the trivia",
- "stats": {
- "correct": 9,
- "incorrect": 3,
- "percentage_correct": 75
}
}
}Returns a set of questions from 'football' tags (103 and 105)
count is less than 10, 10 is usedcount is greater than 50, 50 is usedhash can be tested. The hashing formula is md5(salt+option_id) where the salt is the pre-determined value. For implementations where 'cheating' is of consequence, the hash functionality may be removed. operationId: getQuestionsFootball
| count required | integer [ 1 .. 50 ] Example: 10 The count of questions |
{- "data": [
- {
- "id": 100,
- "text": "What is Saskatchewan?",
- "image_url": "string",
- "caption": "string",
- "source": "string",
- "format": "text",
- "elo": 1000,
- "rating": "Easy",
- "hash": "string",
- "options": [
- {
- "id": "f504712b-e173-4af6-86f9-58b4993392b0",
- "text": "Saskatchewan",
- "caption": "A square",
- "format": "text",
- "links": {
}
}
], - "tags": [
- {
- "id": 6,
- "name": "Sports"
}
]
}
]
}Submits one basic resonse to a question for the football game.
Behaves the same asPOST /api/questions/{id}/options/{uuid}/basic with the exception that football stats are logged for building football-sepcific leaderboards and badge awards
| id required | integer >= 1 The id of the questions |
| uuid required | string The uuid of the option |
{- "data": {
- "is_correct": true,
- "additional_facts": "Some optional facts about the trivia",
- "stats": {
- "correct": 9,
- "incorrect": 3,
- "percentage_correct": 75
}
}
}Returns a leaderboard of the total questions responded to.
The leaderboard is the topcount users who, over the last days have responded to the most total questions, both correctly and incorrectly. operationId: getLeaderboardTotal
| count required | integer [ 1 .. 25 ] Example: 10 The number of distinct users to return |
| days required | integer [ 1 .. 30 ] Example: 7 The number of days back from now to sample |
{
}Returns a leaderboard of the total questions responded to correctly.
The leaderboard is the topcount users who, over the last days have responded to the most total questions correctly operationId: getLeaderboardCorrect
| count required | integer [ 1 .. 25 ] Example: 10 The number of distinct users to return |
| days required | integer [ 1 .. 30 ] Example: 7 The number of days back from now to sample |
{
}Returns a leaderboard of the highest correct ratios
The leaderboard is the topcount users by the ratio of correct answers over the last days days. Users must have responded to, on average, a minimum of two questions per day to be included in the leaderboard. operationId: getLeaderboardRatio
| count required | integer [ 1 .. 25 ] Example: 10 The number of distinct users to return |
| days required | integer [ 1 .. 30 ] Example: 7 The number of days back from now to sample |
{
}{- "data": {
- "start_date": "2025-03-01 12:34:56",
- "end_date": "2025-03-01 12:34:56",
- "total_responses": 18,
- "total_responses_correct": 9,
- "highest_user_elo": 1410,
- "lowest_user_elo": 980,
- "current_user_elo": 1280,
- "highest_correct_elo": 1740,
- "current_streak": 4,
- "longest_streak": 8,
- "total_yards": 350,
- "total_complete": 3,
- "ratio": 50
}
}