{"info":{"_postman_id":"dd35f3b0-7299-4349-9862-cc360efccae1","name":"PlayPower API Documentation","description":"<html><head></head><body><p>Base URL: <code>https://playpower-zjeu.onrender.com</code></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"27974052","collectionId":"dd35f3b0-7299-4349-9862-cc360efccae1","publishedId":"2sAXjRWpde","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-09-08T16:25:54.000Z"},"item":[{"name":"Register","id":"ae32ede0-fac9-4cbe-a677-0d095f145559","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n  \"username\": \"kathan07\",\r\n  \"email\": \"kathanythakkar07@gmail.com\",\r\n  \"password\": \"securePassword123\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"https://playpower-zjeu.onrender.com/auth/register","description":"<p>This endpoint allows new users to create an account on the PlayPower platform.</p>\n<ul>\n<li><p><code>username</code>: A unique username for the account</p>\n</li>\n<li><p><code>email</code>: A valid email address</p>\n</li>\n<li><p><code>password</code>: A secure password for the account</p>\n</li>\n<li><p><strong>Success Response:</strong></p>\n<ul>\n<li><p>Code: 201 CREATED</p>\n</li>\n<li><p>Content: { message: \"User registered successfully\" }</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Error Response:</strong></p>\n<ul>\n<li><p>Code: 400 BAD REQUEST</p>\n</li>\n<li><p>Content: { error: \"Username already exists\" }</p>\n</li>\n<li><p>OR</p>\n</li>\n<li><p>Code: 400 BAD REQUEST</p>\n</li>\n<li><p>Content: { error: \"Email already in use\" }</p>\n</li>\n</ul>\n</li>\n</ul>\n","urlObject":{"protocol":"https","path":["auth","register"],"host":["playpower-zjeu","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"ae32ede0-fac9-4cbe-a677-0d095f145559"},{"name":"Login","id":"fc03479e-bc61-4cba-9482-24954d1b3545","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"kathanythakkar07@gmail.com\",\r\n    \"password\": \"securePassword123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://playpower-zjeu.onrender.com/auth/login","description":"<p>This endpoint authenticates a user and provides a token for subsequent API calls.</p>\n<ul>\n<li><p><code>email</code>: The registered email address</p>\n</li>\n<li><p><code>password</code>: The account password</p>\n</li>\n</ul>\n<p><strong>Success Response:</strong></p>\n<ul>\n<li><p>Code: 200 OK</p>\n</li>\n<li><p>\"user\": { \"id\": \"user_id_here\", \"username\": \"kathan07\", \"email\": \"<a href=\"https://mailto:kathanythakkar07@gmail.com\">kathanythakkar07@gmail.com</a>\", // Other user information fields }}</p>\n</li>\n<li><p>Cookies: The response will set session cookies in the browser. These cookies should be included automatically in subsequent requests to authenticated endpoints.</p>\n</li>\n</ul>\n<p><strong>Error Response:</strong></p>\n<ul>\n<li><p>Code: 401 UNAUTHORIZED</p>\n</li>\n<li><p>Content: { error: \"Invalid credentials\" }</p>\n</li>\n</ul>\n","urlObject":{"protocol":"https","path":["auth","login"],"host":["playpower-zjeu","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"fc03479e-bc61-4cba-9482-24954d1b3545"},{"name":"Logout","id":"f7dbf994-12b2-418d-a541-88667d28dcd8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://playpower-zjeu.onrender.com/auth/logout","description":"<p>This endpoint logs out the currently authenticated user, invalidating their session token and clearing session cookies.</p>\n<p><strong>Success Response:</strong></p>\n<ul>\n<li><p>Code: 200 OK</p>\n</li>\n<li><p>Content: { message: \"Logged out successfully\" }</p>\n</li>\n<li><p>Cookies: The response will clear the session cookies set during login.</p>\n</li>\n</ul>\n","urlObject":{"protocol":"https","path":["auth","logout"],"host":["playpower-zjeu","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"f7dbf994-12b2-418d-a541-88667d28dcd8"},{"name":"generateQuiz","id":"d79a4b1b-8417-45ae-aa75-0747f2e1d271","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n  \"grade\": 11,\r\n  \"Subject\": \"Maths\",\r\n  \"TotalQuestions\": 1,\r\n  \"MaxScore\": 10,\r\n  \"Difficulty\": \"Hard\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"https://playpower-zjeu.onrender.com/quiz/generate","description":"<p>This endpoint generates a new quiz based on the provided parameters such as grade level, subject, and difficulty.</p>\n<ul>\n<li><p><code>grade</code>: The grade level for the quiz (e.g., 11)</p>\n</li>\n<li><p><code>Subject</code>: The subject of the quiz (e.g., \"Maths\")</p>\n</li>\n<li><p><code>TotalQuestions</code>: The number of questions in the quiz</p>\n</li>\n<li><p><code>MaxScore</code>: The maximum score possible for the quiz</p>\n</li>\n<li><p><code>Difficulty</code>: The difficulty level of the quiz (e.g., \"Easy\", \"Medium\", \"Hard\")</p>\n</li>\n<li><p><strong>Success Response:</strong></p>\n<ul>\n<li><p>Code: 200 OK</p>\n</li>\n<li><p>Content: { quizId: \"QUIZ_ID\", questions: [...] }</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Error Response:</strong></p>\n<ul>\n<li><p>Code: 400 BAD REQUEST</p>\n</li>\n<li><p>Content: { error: \"Invalid parameters\" }</p>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Note:</strong> This endpoint requires authentication. Ensure that your session cookies are included with the request.</p>\n","urlObject":{"protocol":"https","path":["quiz","generate"],"host":["playpower-zjeu","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"d79a4b1b-8417-45ae-aa75-0747f2e1d271"},{"name":"submitQuiz","id":"e878c6f3-d8e6-4103-923b-a7c5e6f5ef1a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n  \"quizId\": \"66dc7bdb9b6653b748bc51bd\",\r\n  \"answers\": [\r\n    {\r\n      \"selectedAnswer\": \"-13\"\r\n    }\r\n  ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://playpower-zjeu.onrender.com/quiz/submit","description":"<p>This endpoint allows users to submit their answers for a quiz.</p>\n<ul>\n<li><p><code>quizId</code>: The ID of the quiz being submitted</p>\n</li>\n<li><p><code>answers</code>: An array of selected answers for each question</p>\n</li>\n<li><p><strong>Success Response:</strong></p>\n<ul>\n<li><p>Code: 200 OK</p>\n</li>\n<li><p>Content: { score: number, feedback: [...] }</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Error Response:</strong></p>\n<ul>\n<li><p>Code: 400 BAD REQUEST</p>\n</li>\n<li><p>Content: { error: \"Invalid quiz ID\" }</p>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Note:</strong> This endpoint requires authentication. Ensure that your session cookies are included with the request.</p>\n","urlObject":{"protocol":"https","path":["quiz","submit"],"host":["playpower-zjeu","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"e878c6f3-d8e6-4103-923b-a7c5e6f5ef1a"},{"name":"quizHistory","id":"8909ac31-ee4b-461d-8f72-9e6c8dd490f1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://playpower-zjeu.onrender.com/quiz/history?grade=11","description":"<p>This endpoint retrieves the quiz history for a specific grade level.</p>\n<ul>\n<li><p><strong>Query Parameters:</strong></p>\n<ul>\n<li><code>grade</code>: number (The grade level to retrieve history for)</li>\n</ul>\n</li>\n<li><p><strong>Example:</strong> <code>/quiz/history?grade=11</code></p>\n</li>\n<li><p><strong>Success Response:</strong></p>\n<ul>\n<li><p>Code: 200 OK</p>\n</li>\n<li><p>Content: <code>{ \"quizzes\": [...] }</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Error Response:</strong></p>\n<ul>\n<li><p>Code: 400 BAD REQUEST</p>\n</li>\n<li><p>Content: <code>{ \"error\": \"Invalid value\" }</code></p>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Note:</strong> This endpoint requires authentication. Ensure that your session cookies are included with the request.</p>\n","urlObject":{"protocol":"https","path":["quiz","history"],"host":["playpower-zjeu","onrender","com"],"query":[{"key":"grade","value":"11"}],"variable":[]}},"response":[],"_postman_id":"8909ac31-ee4b-461d-8f72-9e6c8dd490f1"},{"name":"RetryQuiz","id":"5b18059f-d1ca-4b9e-8837-17bc9b045a40","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n  \"quizId\": \"66dc7bdb9b6653b748bc51bd\",\r\n  \"answers\": [\r\n    {\r\n      \"selectedAnswer\": \"-11\"\r\n    }\r\n  ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://playpower-zjeu.onrender.com/quiz/retry","description":"<p>This endpoint allows users to retry a previously taken quiz with new answers.</p>\n<ul>\n<li><p><code>quizId</code>: The ID of the quiz being retried</p>\n</li>\n<li><p><code>answers</code>: An array of new selected answers for each question</p>\n</li>\n<li><p><strong>Success Response:</strong></p>\n<ul>\n<li><p>Code: 200 OK</p>\n</li>\n<li><p>Content: <code>{ \"score\": number, \"feedback\": [...] }</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Error Response:</strong></p>\n<ul>\n<li><p>Code: 400 BAD REQUEST</p>\n</li>\n<li><p>Content: <code>{ \"error\": \"Invalid quiz ID\" }</code></p>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Note:</strong> This endpoint requires authentication. Ensure that your session cookies are included with the request.</p>\n","urlObject":{"protocol":"https","path":["quiz","retry"],"host":["playpower-zjeu","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"5b18059f-d1ca-4b9e-8837-17bc9b045a40"},{"name":"GetHint","id":"297b5a59-49c6-4604-9965-fb859a84a9e7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://playpower-zjeu.onrender.com/quiz/hint/66dc7bdb9b6653b748bc51be","description":"<ul>\n<li><p>This endpoint provides a hint for a specific question in a quiz.</p>\n</li>\n<li><p><strong>Parameters:</strong></p>\n<ul>\n<li><code>questionId</code>: The ID of the question to get a hint for</li>\n</ul>\n</li>\n<li><p><strong>Example:</strong> <code>/quiz/hint/66dc7bdb9b6653b748bc51be</code></p>\n</li>\n<li><p><strong>Success Response:</strong></p>\n<ul>\n<li><p>Code: 200 OK</p>\n</li>\n<li><p>Content: <code>{ \"hint\": \"string\" }</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Error Response:</strong></p>\n<ul>\n<li><p>Code: 404 NOT FOUND</p>\n</li>\n<li><p>Content: <code>{ \"error\": \"Question not found\" }</code></p>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Note:</strong> This endpoint requires authentication. Ensure that your session cookies are included with the request.</p>\n","urlObject":{"protocol":"https","path":["quiz","hint","66dc7bdb9b6653b748bc51be"],"host":["playpower-zjeu","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"297b5a59-49c6-4604-9965-fb859a84a9e7"},{"name":"getQuiz","id":"f8982cac-3659-4d69-b030-0fe77b7debc9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://playpower-zjeu.onrender.com/quiz/66ddbf613abe7a8668e7ffa5","description":"<ul>\n<li><p>This endpoint retrieves the details of a specific quiz, including questions and correct answers if the quiz has been completed.</p>\n</li>\n<li><p><strong>Parameters:</strong></p>\n<ul>\n<li><code>quizId</code>: The ID of the quiz to retrieve</li>\n</ul>\n</li>\n<li><p><strong>Example:</strong> <code>/quiz/66ddbf613abe7a8668e7ffa5</code></p>\n</li>\n<li><p><strong>Success Response:</strong></p>\n<ul>\n<li><p>Code: 200 OK</p>\n</li>\n<li><p>Content: <code>{ \"quizDetails\": {...}, \"questions\": [...] }</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Error Response:</strong></p>\n<ul>\n<li><p>Code: 404 NOT FOUND</p>\n</li>\n<li><p>Content: <code>{ \"error\": \"Quiz not found\" }</code></p>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Note:</strong> This endpoint requires authentication. Ensure that your session cookies are included with the request.</p>\n","urlObject":{"protocol":"https","path":["quiz","66ddbf613abe7a8668e7ffa5"],"host":["playpower-zjeu","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"f8982cac-3659-4d69-b030-0fe77b7debc9"}]}