{"info":{"_postman_id":"6d5bf50d-49be-40a6-89ba-de9a9c4fa01c","name":"Backend-Nustutor","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"31682644","collectionId":"6d5bf50d-49be-40a6-89ba-de9a9c4fa01c","publishedId":"2s9YkgERHY","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2023-12-09T10:05:42.000Z"},"item":[{"name":"Signup - SignupUser","id":"08cdb18a-a191-4b1e-9265-4e71505b8ee0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n  \"email\": \"khan.hadi2951@gmail.com\",\r\n  \"fullname\": \"Hadi Khan\",\r\n  \"password\": \"SecurePassword\",\r\n  \"semester\": 3,\r\n  \"degree\": \"Computer Science\",\r\n  \"dept\": \"IT Department\",\r\n  \"bio\": \"A brief bio or description\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"localhost:4306/api/v1/signup/","description":"<h1 id=\"expected-response\"><strong>Expected response:</strong></h1>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"User created successfully and verification email sent\"\n}\n\n</code></pre>\n<h1 id=\"error-responses\"><strong>Error responses:</strong></h1>\n<p>(Error will be longer, these will be a substring inside a json object)</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">Email or username already exists\nInternal Server Error when sending verification mail\n\n</code></pre>\n<p>After creation, it sends an email to user which contains the link:</p>\n<p><code>${{frontend-url}}/verifyEmail/${{ emailVerificationCode }}/</code></p>\n<p>The email verification code will be generated by the backend. Now, the frontend must have a page according to the above parameters which will call the backend api : SignupVerifyEmailByCode</p>\n","urlObject":{"port":"4306","path":["api","v1","signup",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"08cdb18a-a191-4b1e-9265-4e71505b8ee0"},{"name":"Signup - VerfiyEmailByCode","id":"b163eddc-78a3-4759-8e18-8c4cb767f41b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"localhost:4306/api/v1/signup/verifyEmail/{{emailVerificationCode}}","description":"<h1 id=\"expected-response\"><strong>Expected response:</strong></h1>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Email verified successfully\"\n}\n\n</code></pre>\n<h1 id=\"error-responses\"><strong>Error responses:</strong></h1>\n<p>(Error will be longer, these will be a substring inside a json object)</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">Internal DB Server Error\nEmail verification failed, no user found.\n\n</code></pre>\n<p>This will verify the user email. The next step is to login.</p>\n","urlObject":{"port":"4306","path":["api","v1","signup","verifyEmail","{{emailVerificationCode}}"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"b163eddc-78a3-4759-8e18-8c4cb767f41b"},{"name":"Login - LoginUser","id":"387901af-a9f3-4a81-8b94-8eb13a277755","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"khan.hadi2951@gmail.com\",\r\n    \"password\": \"SecurePassword\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:4306/api/v1/login","description":"<h1 id=\"expected-response\"><strong>Expected response:</strong></h1>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"userID\": \"&lt;unique user ID, UUID, created when signing up&gt;\",\n    \"token\": \"&lt;JWT Token, contains UUID in the encrypted form&gt;\"\n}\n\n</code></pre>\n<h1 id=\"error-responses\"><strong>Error responses:</strong></h1>\n<p>(Error will be longer, these will be a substring inside a json object)</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">Invalid password\nEmail field missing or does not exist\nInternal Server Error when getting user\n\n</code></pre>\n<p>This will login the user. The user ID and the JWT token must both be saved in headers as they will be used again and again in the next protected routes. So any API call next must contain both of these.</p>\n","urlObject":{"port":"4306","path":["api","v1","login"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"387901af-a9f3-4a81-8b94-8eb13a277755"},{"name":"Tutor - Signup","id":"30a7d6e8-8745-4fcb-9399-e8ca71229a4d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDIxMTY0ODIsImV4cCI6MTcwMjI4OTI4Mn0.0dX9c1eE_YsZxjKp0FKv-xVcN5RjOV7az0NfRhd4u6o","type":"text"},{"key":"uuid","value":"18b6e77a-9679-11ee-ae53-7413ea3bf082","type":"text"}],"url":"localhost:4306/api/v1/tutor/signup/","description":"<h1 id=\"expected-response\"><strong>Expected response:</strong></h1>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Tutor account created successfully\"\n}\n\n</code></pre>\n<h1 id=\"error-responses\"><strong>Error responses:</strong></h1>\n<p>(Error will be longer, these will be a substring inside a json object)</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">UUID already exists\nError when verifying token\nUnauthorized: User ID does not exist.\nUnauthorized: Token does not match user ID\n\n</code></pre>\n","urlObject":{"port":"4306","path":["api","v1","tutor","signup",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"30a7d6e8-8745-4fcb-9399-e8ca71229a4d"},{"name":"Tutor- GetTutor (Tutor view)","event":[{"listen":"test","script":{"id":"a0735f78-8c99-4e05-856a-85b902ffca98","exec":["var template = `\r","<style type=\"text/css\">\r","    .tftable {font-size:14px;color:#333333;width:100%;border-width: 1px;border-color: #87ceeb;border-collapse: collapse;}\r","    .tftable th {font-size:18px;background-color:#87ceeb;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;text-align:left;}\r","    .tftable tr {background-color:#ffffff;}\r","    .tftable td {font-size:14px;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;}\r","    .tftable tr:hover {background-color:#e0ffff;}\r","</style>\r","\r","<table class=\"tftable\" border=\"1\">\r","    <tr>\r","        <th>Title</th>\r","        <th>External Path</th>\r","        <th>Locations</th>\r","        <th>Posted On</th>\r","        <th>Bullet Fields</th>\r","    </tr>\r","    \r","    {{#each response.jobPostings}}\r","        <tr>\r","            <td>{{title}}</td>\r","            <td>{{externalPath}}</td>\r","            <td>{{locationsText}}</td>\r","            <td>{{postedOn}}</td>\r","            <td>{{bulletFields}}</td>\r","        </tr>\r","    {{/each}}\r","</table>\r","`;\r","\r","function constructVisualizerPayload() {\r","    return {response: pm.response.json()}\r","}\r","\r","pm.visualizer.set(template, constructVisualizerPayload());"],"type":"text/javascript"}}],"id":"155f12d2-fe29-4213-9853-4b9e50af8ace","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"","value":"","type":"text"},{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDI5MjIxNDcsImV4cCI6MTcwMzA5NDk0N30.D1j0NaaTYI0wFY78yDUlNwZCJCPVFVRTmP8YEARYYXA","type":"text"},{"key":"uuid","value":"18b6e77a-9679-11ee-ae53-7413ea3bf082","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"localhost:4306/api/v1/tutor/tutorview/gettutor/","urlObject":{"port":"4306","path":["api","v1","tutor","tutorview","gettutor",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"155f12d2-fe29-4213-9853-4b9e50af8ace"},{"name":"Tutor - GetTutor (User view)","id":"c9a68982-83bc-491b-b3ec-bb6604778cdc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDI0OTExNzIsImV4cCI6MTcwMjY2Mzk3Mn0.sGgUfMJiRRwE6xXQpNAPVUb-QiGvVaYQny5lDBxHays","type":"text"},{"key":"uuid","value":"18b6e77a-9679-11ee-ae53-7413ea3bf082","type":"text"}],"url":"localhost:4306/api/v1/tutor/gettutor/","urlObject":{"port":"4306","path":["api","v1","tutor","gettutor",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"c9a68982-83bc-491b-b3ec-bb6604778cdc"},{"name":"Tutor - AddLink","id":"8dd9e38d-ef3d-401c-bfb2-7e11d9a23a5c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDI0OTExNzIsImV4cCI6MTcwMjY2Mzk3Mn0.sGgUfMJiRRwE6xXQpNAPVUb-QiGvVaYQny5lDBxHays","type":"text"},{"key":"uuid","value":"18b6e77a-9679-11ee-ae53-7413ea3bf082","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"tuid\": \"b4a1f26b-967d-11ee-ae53-7413ea3bf082\",\r\n    \"link\" : \"www.github.com/okHadi\",\r\n    \"platform\": \"Github\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:4306/api/v1/tutor/addsociallink/","urlObject":{"port":"4306","path":["api","v1","tutor","addsociallink",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"8dd9e38d-ef3d-401c-bfb2-7e11d9a23a5c"},{"name":"Tutor - GetLinks","id":"9ac51434-6446-44e8-9aa7-7d45b9ed5a98","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDI5MjIxNDcsImV4cCI6MTcwMzA5NDk0N30.D1j0NaaTYI0wFY78yDUlNwZCJCPVFVRTmP8YEARYYXA","type":"text"},{"key":"uuid","value":"18b6e77a-9679-11ee-ae53-7413ea3bf082","type":"text"}],"url":"localhost:4306/api/v1/tutor/gettutorlinks/b4a1f26b-967d-11ee-ae53-7413ea3bf082","urlObject":{"port":"4306","path":["api","v1","tutor","gettutorlinks","b4a1f26b-967d-11ee-ae53-7413ea3bf082"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"9ac51434-6446-44e8-9aa7-7d45b9ed5a98"},{"name":"Tutor - GetClasses","id":"3edafff0-5547-456f-825d-ac11b461eab0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDI5MjIxNDcsImV4cCI6MTcwMzA5NDk0N30.D1j0NaaTYI0wFY78yDUlNwZCJCPVFVRTmP8YEARYYXA","type":"text"},{"key":"uuid","value":"18b6e77a-9679-11ee-ae53-7413ea3bf082","type":"text"}],"url":"localhost:4306/api/v1/tutor/getofferedclasses/b4a1f26b-967d-11ee-ae53-7413ea3bf082","urlObject":{"port":"4306","path":["api","v1","tutor","getofferedclasses","b4a1f26b-967d-11ee-ae53-7413ea3bf082"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"3edafff0-5547-456f-825d-ac11b461eab0"},{"name":"Subject - GetAllSubjects","id":"b61671f9-3da9-4804-8ed8-8bc075c7b95e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDI5MjIxNDcsImV4cCI6MTcwMzA5NDk0N30.D1j0NaaTYI0wFY78yDUlNwZCJCPVFVRTmP8YEARYYXA","type":"text"},{"key":"uuid","value":"18b6e77a-9679-11ee-ae53-7413ea3bf082","type":"text"}],"body":{"mode":"raw","raw":""},"url":"localhost:4306/api/v1/subject/","urlObject":{"port":"4306","path":["api","v1","subject",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"b61671f9-3da9-4804-8ed8-8bc075c7b95e"},{"name":"Subject - GetSubjectByID","id":"99a0eef9-0c00-407b-8342-85506bde47f7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDI0OTExNzIsImV4cCI6MTcwMjY2Mzk3Mn0.sGgUfMJiRRwE6xXQpNAPVUb-QiGvVaYQny5lDBxHays","type":"text"},{"key":"uuid","value":"b4a1f26b-967d-11ee-ae53-7413ea3bf082","type":"text"}],"url":"localhost:4306/api/v1/subject/subjectid/b2d6c5ca-975d-11ee-860f-745d2241629e","urlObject":{"port":"4306","path":["api","v1","subject","subjectid","b2d6c5ca-975d-11ee-860f-745d2241629e"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"99a0eef9-0c00-407b-8342-85506bde47f7"},{"name":"Subject - GetAllDegrees","id":"6aba0f7a-4b5f-4f26-b88f-a677c0a71443","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDI0OTExNzIsImV4cCI6MTcwMjY2Mzk3Mn0.sGgUfMJiRRwE6xXQpNAPVUb-QiGvVaYQny5lDBxHays","type":"text"},{"key":"uuid","value":"b4a1f26b-967d-11ee-ae53-7413ea3bf082","type":"text"}],"url":"localhost:4306/api/v1/subject/degrees","urlObject":{"port":"4306","path":["api","v1","subject","degrees"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"6aba0f7a-4b5f-4f26-b88f-a677c0a71443"},{"name":"Subject - GetAllSubjects (By Degree)","id":"efa9882c-f6cc-4baa-b3cd-d3f783c26b73","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDI0OTExNzIsImV4cCI6MTcwMjY2Mzk3Mn0.sGgUfMJiRRwE6xXQpNAPVUb-QiGvVaYQny5lDBxHays","type":"text"},{"key":"uuid","value":"b4a1f26b-967d-11ee-ae53-7413ea3bf082","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"degree\": \"BACHELOR OF SOFTWARE ENGINEERING \" }","options":{"raw":{"language":"json"}}},"url":"localhost:4306/api/v1/subject/degree_subjects/","urlObject":{"port":"4306","path":["api","v1","subject","degree_subjects",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"efa9882c-f6cc-4baa-b3cd-d3f783c26b73"},{"name":"Subject - Search","id":"1e0d5ae1-a68c-4bc9-9249-d0a2e6e11453","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDI0OTk0NjUsImV4cCI6MTcwMjY3MjI2NX0.fN_F5GnTRh5KU9LF6ai3xtsMHUblUp5V08zBh0uQJjw","type":"text"},{"key":"uuid","value":"18b6e77a-9679-11ee-ae53-7413ea3bf082","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"search_term\": \"Data\" \r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:4306/api/v1/subject/search/","urlObject":{"port":"4306","path":["api","v1","subject","search",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"1e0d5ae1-a68c-4bc9-9249-d0a2e6e11453"},{"name":"Class - AddClass","id":"90004810-1964-47e6-b2a2-b8a1781e91c1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"uuid","value":"18b6e77a-9679-11ee-ae53-7413ea3bf082","type":"text"},{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxOGI2ZTc3YS05Njc5LTExZWUtYWU1My03NDEzZWEzYmYwODIiLCJpYXQiOjE3MDI5MjIxNDcsImV4cCI6MTcwMzA5NDk0N30.D1j0NaaTYI0wFY78yDUlNwZCJCPVFVRTmP8YEARYYXA","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"suid\" : \"b2d6c5ca-975d-11ee-860f-745d2241629e\",\r\n    \"title\" : \"Git and Github\",\r\n    \"description\" : \"I will teach you git and github\",\r\n    \"rate\": 500,\r\n    \"multipleStudents\" : true,\r\n    \"availableTimeslots\" : [12, 16]\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:4306/api/v1/class/addclass/b4a1f26b-967d-11ee-ae53-7413ea3bf082","description":"<p>TUID is given in req.params</p>\n","urlObject":{"port":"4306","path":["api","v1","class","addclass","b4a1f26b-967d-11ee-ae53-7413ea3bf082"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"90004810-1964-47e6-b2a2-b8a1781e91c1"}]}