-
Notifications
You must be signed in to change notification settings - Fork 1
GET api questions random
Kherld edited this page Sep 11, 2023
·
2 revisions
This endpoint allows you to retrieve random quiz questions.
GET http://localhost:8081/api/questions/random
-
limit
(integer, optional): Specifies the maximum number of random questions to retrieve. Defaults to no limit.
-
200 OK
: Returns a list of random quiz questions.[ { "id": 1, "question": "What is the greatest worship?", "question_type": "multiple-choice", "answers": ["the prayer", "Zakat", "unification. -- Tawheed"], "correct_answer": "unification. -- Tawheed", "event_month": "null" }, // ... (more questions) ]
-
400 Bad Request
: If the provided limit parameter is invalid. -
404 Not Found
: If there are no random questions available. -
500 Internal Server Error
: If there's an issue with retrieving the random questions from the server
Request: GET /api/questions/random?limit=5
Retrieves 5 random quiz questions.
Request: GET /api/questions/random
Retrieves random quiz questions without a specified limit.
- The limit parameter is optional and allows you to specify the maximum number of random questions to retrieve. If not provided, all available random questions will be returned.
- This endpoint provides a way to get random questions from the quiz question pool.