Quizer API Documentation
Introduction
This is an API of Quizer game
POST/api/v1/questions
/api/v1/questions
Add question to db
Bodyraw
{
"question": "Question 1",
"img": "**IMG_IN_BASE64_FORMAT**",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4",
"password": "**ADMIN_PASSWORD**"
}
Example Request
Default
curl
curl --location '/api/v1/questions' \
--data '{
"question": "Question 1",
"img": "**IMG_IN_BASE64_FORMAT**",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4",
"password": "**ADMIN_PASSWORD**"
}'
Example Response
{
"success": "true",
"message": "Question added successfully",
"content": {
"id": 1,
"question": "Question 1",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
}
}
No response headers
This request doesn't return any response headers
GET/api/v1/questions
/api/v1/questions
Get 10 random questions from db
Example Request
Default
curl
curl --location '/api/v1/questions' \
--data ''
Example Response
{
"success": "true",
"message": "Random questions received",
"content": [
{
"id": 7,
"question": "Question 7",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 6,
"question": "Question 6",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 8,
"question": "Question 8",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 2,
"question": "Question 2",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 4,
"question": "Question 4",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 10,
"question": "Question 10",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 3,
"question": "Question 3",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 9,
"question": "Question 9",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 5,
"question": "Question 5",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 1,
"question": "Question 1",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
}
]
}
No response headers
This request doesn't return any response headers
GET/api/v1/questions/all
/api/v1/questions/all
Get all questions from db
Example Request
Default
curl
curl --location '/api/v1/questions/all' \
--data ''
Example Response
{
"success": "true",
"message": "OK",
"content": [
{
"id": 1,
"question": "Question 1",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 2,
"question": "Question 2",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 3,
"question": "Question 3",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 4,
"question": "Question 4",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 5,
"question": "Question 5",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 6,
"question": "Question 6",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 7,
"question": "Question 7",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 8,
"question": "Question 8",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 9,
"question": "Question 9",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
},
{
"id": 10,
"question": "Question 10",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
}
]
}
No response headers
This request doesn't return any response headers
PUT/api/v1/questions/:id
/api/v1/questions/:id
Update question in db
PATH VARIABLES
id
Bodyraw
{
"question": "Question 11",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4",
"password": "1234"
}
Example Request
Default
curl
curl --location --request PUT '/api/v1/questions/:id' \
--data '{
"question": "Question 11",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4",
"password": "1234"
}'
Example Response
{
"success": "true",
"message": "Question replaced successfully",
"content": {
"id": 11,
"question": "Question 11",
"img": "null",
"answer1": "First answer",
"answer2": "Second answer",
"answer3": "Third answer",
"answer4": "This is good answer",
"goodAnswer": "4"
}
}
No response headers
This request doesn't return any response headers