{"info":{"_postman_id":"862fac5a-5dcd-462a-9c5d-a4e0ed95b653","name":"Assign-Mentor API","description":"<html><head></head><body><p>This documentation provides details about the Assign-Mentor API, implemented using Node.js and Express. This API allows you to manage mentors and students, assign mentors to students, change mentors, and retrieve mentor-student relationships.</p>\n<p><strong>Base URL</strong>: <a href=\"https://nodejs-assignmentor-r0cu.onrender.com\"><code>http://localhost:4000</code><br><br></a></p>\n<p><strong>Packages installed</strong>:</p>\n<ul>\n<li><p><strong>Express</strong>: <code>npm install express</code></p>\n</li>\n<li><p><strong>Cors</strong>: <code>npm install cors</code></p>\n</li>\n<li><p><strong>Dotenv</strong>: <code>npm install dotenv</code></p>\n</li>\n<li><p><strong>Mongoose</strong>: <code>npm install mongoose</code></p>\n</li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"35182338","collectionId":"862fac5a-5dcd-462a-9c5d-a4e0ed95b653","publishedId":"2sA3QtfC1k","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-05-29T17:43:56.000Z"},"item":[{"name":"Create Mentor","id":"b84f71e9-64d1-456f-812f-d8794a98dbf1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Kakashi\",\r\n    \"email\": \"copyninja@naruto.com\",\r\n    \"batch\": \"anime\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/mentor/create","description":"<h4 id=\"create-mentor\">Create Mentor</h4>\n<p><strong>Description</strong>: Creates a new mentor with details about the mentor.</p>\n<p><strong>URL</strong>: <code>/api/mentor/create</code></p>\n<p><strong>Method</strong>: POST<br /><strong>Example</strong>: <code>http://localhost:4000/api/mentor/create</code></p>\n","urlObject":{"protocol":"http","port":"4000","path":["api","mentor","create"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"3b8ea80c-6e7c-4708-9f57-f5621d245b20","name":"Create mentor","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Kakashi\",\r\n    \"email\": \"copyninja@naruto.com\",\r\n    \"batch\": \"anime\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/mentor/create"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"106"},{"key":"ETag","value":"W/\"6a-thV4XQoUuuTipmMIdYED24h4NTo\""},{"key":"Date","value":"Wed, 29 May 2024 12:04:32 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"name\": \"Kakashi\",\n    \"email\": \"copyninja@naruto.com\",\n    \"batch\": \"anime\",\n    \"_id\": \"665719d090123c0986bbff2a\",\n    \"__v\": 0\n}"}],"_postman_id":"b84f71e9-64d1-456f-812f-d8794a98dbf1"},{"name":"Create Student","id":"bb559dab-364f-49a4-9dab-998a92c1e4ea","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\":\"Sauske\",\r\n    \"email\":\"lastuchiga@onepiece.com\",\r\n    \"batch\":\"anime\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/student/create","description":"<h4 id=\"post-create-student\">POST Create Student</h4>\n<p><strong>URL</strong>: <code>/api/student/create</code></p>\n<p><strong>Description</strong>: Creates a new student with details about the student.</p>\n<p><strong>Method</strong>: POST</p>\n<p><strong>Example</strong>: <code>http://localhost:4000/api/student/create</code></p>\n","urlObject":{"protocol":"http","port":"4000","path":["api","student","create"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"fab3a05e-a5fb-4670-ad00-a9e08c060a6e","name":"Create student","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\":\"Sauske\",\r\n    \"email\":\"lastuchiga@onepiece.com\",\r\n    \"batch\":\"anime\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/student/create"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"129"},{"key":"ETag","value":"W/\"81-LXWmtoDmsIpWCDhYJRU+dYPNF6s\""},{"key":"Date","value":"Wed, 29 May 2024 12:13:22 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"name\": \"Sauske\",\n    \"email\": \"lastuchiga@onepiece.com\",\n    \"batch\": \"anime\",\n    \"previousMentors\": [],\n    \"_id\": \"66571be201359215f8c7117e\",\n    \"__v\": 0\n}"}],"_postman_id":"bb559dab-364f-49a4-9dab-998a92c1e4ea"},{"name":"Display All Mentors","id":"4b6760d0-3c04-4cc9-9ec1-b823540a0cd0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:4000/api/mentor/all-mentors","description":"<p>Display All Mentors</p>\n<p><strong>URL</strong>: <code>/api/mentor/mentors</code></p>\n<p><strong>Description</strong>: Retrieves and displays the list of all mentors.</p>\n<p><strong>Method</strong>: GET</p>\n<p><strong>Example</strong>: <code>http://localhost:4000/api/mentor/all-mentors</code></p>\n","urlObject":{"protocol":"http","port":"4000","path":["api","mentor","all-mentors"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"88e61606-33e4-4417-aa0f-ecbb45e59e1f","name":"Display all mentors","originalRequest":{"method":"GET","header":[],"url":"http://localhost:4000/api/mentor/all-mentors"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"554"},{"key":"ETag","value":"W/\"22a-iphxdA1qip42qZJmOhhSXTbfLYc\""},{"key":"Date","value":"Wed, 29 May 2024 12:15:07 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"_id\": \"665716d86eebd693694b38a2\",\n        \"name\": \"Rayleigh\",\n        \"email\": \"darkking@onepiece.com\",\n        \"__v\": 0,\n        \"batch\": \"anime\"\n    },\n    {\n        \"_id\": \"665717036eebd693694b38a4\",\n        \"name\": \"Mihawk\",\n        \"email\": \"strongestswordmen@onepiece.com\",\n        \"__v\": 0,\n        \"batch\": \"anime\"\n    },\n    {\n        \"_id\": \"6657175a6eebd693694b38a6\",\n        \"name\": \"Uhrahara\",\n        \"email\": \"cunningshinigami@bleach.com\",\n        \"__v\": 0,\n        \"batch\": \"anime\"\n    },\n    {\n        \"_id\": \"665717916eebd693694b38a8\",\n        \"name\": \"Jiraya\",\n        \"email\": \"pervysage@naruto.com\",\n        \"__v\": 0,\n        \"batch\": \"anime\"\n    },\n    {\n        \"_id\": \"665719d090123c0986bbff2a\",\n        \"name\": \"Kakashi\",\n        \"email\": \"copyninja@naruto.com\",\n        \"batch\": \"anime\",\n        \"__v\": 0\n    }\n]"}],"_postman_id":"4b6760d0-3c04-4cc9-9ec1-b823540a0cd0"},{"name":"Display all Students","id":"bdab3152-84fc-49ce-b289-109c542e3327","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:4000/api/student/all-students","description":"<h4 id=\"get-display-all-students\">GET Display All Students</h4>\n<p><strong>URL</strong>: <code>/api/student/students</code></p>\n<p><strong>Description</strong>: Retrieves and displays the list of all students.</p>\n<p><strong>Method</strong>: GET</p>\n<p><strong>Example</strong>: <code>http://localhost:4000/api/student/all-students</code></p>\n","urlObject":{"protocol":"http","port":"4000","path":["api","student","all-students"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"e901068b-bf21-43f3-9796-3f935e1fddba","name":"Display all Students","originalRequest":{"method":"GET","header":[],"url":"http://localhost:4000/api/student/all-students"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"791"},{"key":"ETag","value":"W/\"317-LccxX1WGSPyVk5L0kEJg1kzMHPM\""},{"key":"Date","value":"Wed, 29 May 2024 12:18:58 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"previousMentors\": [],\n        \"_id\": \"66571af001359215f8c71174\",\n        \"name\": \"Luffy\",\n        \"email\": \"kingofpirates@onepiece.com\",\n        \"batch\": \"anime\",\n        \"__v\": 0\n    },\n    {\n        \"previousMentors\": [],\n        \"_id\": \"66571b2301359215f8c71176\",\n        \"name\": \"Shanks\",\n        \"email\": \"kingmaker@onepiece.com\",\n        \"batch\": \"anime\",\n        \"__v\": 0\n    },\n    {\n        \"previousMentors\": [],\n        \"_id\": \"66571b3f01359215f8c71178\",\n        \"name\": \"Zoro\",\n        \"email\": \"kingofhell@onepiece.com\",\n        \"batch\": \"anime\",\n        \"__v\": 0\n    },\n    {\n        \"previousMentors\": [],\n        \"_id\": \"66571b6e01359215f8c7117a\",\n        \"name\": \"Ichigo\",\n        \"email\": \"substituteshinigami@onepiece.com\",\n        \"batch\": \"anime\",\n        \"__v\": 0\n    },\n    {\n        \"previousMentors\": [],\n        \"_id\": \"66571bbc01359215f8c7117c\",\n        \"name\": \"Naruro\",\n        \"email\": \"Hokageofleaf@onepiece.com\",\n        \"batch\": \"anime\",\n        \"__v\": 0\n    },\n    {\n        \"previousMentors\": [],\n        \"_id\": \"66571be201359215f8c7117e\",\n        \"name\": \"Sauske\",\n        \"email\": \"lastuchiga@onepiece.com\",\n        \"batch\": \"anime\",\n        \"__v\": 0\n    }\n]"}],"_postman_id":"bdab3152-84fc-49ce-b289-109c542e3327"},{"name":"Assign students to mentor","id":"8cf53cc0-1ba5-4330-a180-41fd47486644","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"std_ids\": [\"66571bbc01359215f8c7117c\",\"66571be201359215f8c7117e\"]\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/mentor/assign/665719d090123c0986bbff2a","description":"<h4 id=\"assign-students-to-mentor\">Assign Students to Mentor</h4>\n<p><strong>URL</strong>: <code>/api/mentor/assign/:id</code></p>\n<p><strong>Description</strong>: Assigns multiple students to a specific mentor.</p>\n<p><strong>Method</strong>: PUT</p>\n<p><strong>Example</strong>:<code>http://localhost:4000/api/mentor/assign/665719d090123c0986bbff2a</code></p>\n","urlObject":{"protocol":"http","port":"4000","path":["api","mentor","assign","665719d090123c0986bbff2a"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"77497847-fe17-411e-9b6f-acad4ac91b01","name":"Assign Students","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"std_ids\": [\"66571bbc01359215f8c7117c\",\"66571be201359215f8c7117e\"]\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/mentor/assign/665719d090123c0986bbff2a"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"160"},{"key":"ETag","value":"W/\"a0-Ff/dAaHOjzvokq/0TauAeYz+xx8\""},{"key":"Date","value":"Wed, 29 May 2024 12:32:25 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Students assigned successfully\",\n    \"mentor\": {\n        \"_id\": \"665719d090123c0986bbff2a\",\n        \"name\": \"Kakashi\",\n        \"email\": \"copyninja@naruto.com\",\n        \"batch\": \"anime\",\n        \"__v\": 0\n    }\n}"}],"_postman_id":"8cf53cc0-1ba5-4330-a180-41fd47486644"},{"name":"Change mntr for one std","id":"5f53c7e2-6694-495f-9712-626db5cbadcf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"newMentorId\": \"665717916eebd693694b38a8\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/mentor/change-mentor/66571bbc01359215f8c7117c","description":"<h4 id=\"change-mentor-for-one-student\">Change Mentor for One Student</h4>\n<p><strong>URL</strong>: <code>/api/mentor/change-mentor/:id</code></p>\n<p><strong>Description</strong>: Changes the mentor for a specific student and records the previous mentor.</p>\n<p><strong>Method</strong>: PUT</p>\n<p><strong>Example</strong>:</p>\n<p><code>http://localhost:4000/api/mentor/changementor/66571bbc01359215f8c7117c</code></p>\n","urlObject":{"protocol":"http","port":"4000","path":["api","mentor","change-mentor","66571bbc01359215f8c7117c"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"4580e30d-25f8-4d14-b506-d8bb5a7409ac","name":"Change mntr for one std","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"newMentorId\": \"665717916eebd693694b38a8\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:4000/api/mentor/change-mentor/66571bbc01359215f8c7117c"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"41"},{"key":"ETag","value":"W/\"29-wn60wN3lT9VtuOOt7x3MyNWAOno\""},{"key":"Date","value":"Wed, 29 May 2024 14:09:13 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Mentor changed successfully\"\n}"}],"_postman_id":"5f53c7e2-6694-495f-9712-626db5cbadcf"},{"name":"Display students of the mentor","id":"5f17aa44-89c0-4968-a77b-0972d49bb299","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:4000/api/mentor/students/665716d86eebd693694b38a2","description":"<h4 id=\"display-students-of-the-mentor\">Display Students of the Mentor</h4>\n<p><strong>URL</strong>: <code>/api/mentor/students/:id</code></p>\n<p><strong>Description</strong>: Retrieves and displays the list of all students assigned to a specific mentor.</p>\n<p><strong>Method</strong>: GET</p>\n<p><strong>Example</strong>: <code>http://localhost:4000/api/mentor/students/665716d86eebd693694b38a2</code></p>\n","urlObject":{"protocol":"http","port":"4000","path":["api","mentor","students","665716d86eebd693694b38a2"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"6d739aac-6155-4e52-8137-61b93a0a4b39","name":"Display students of the mentor","originalRequest":{"method":"GET","header":[],"url":"http://localhost:4000/api/mentor/students/665716d86eebd693694b38a2"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"393"},{"key":"ETag","value":"W/\"189-rVHckNorJTFlxfh9q3aTEN0CRP8\""},{"key":"Date","value":"Wed, 29 May 2024 14:12:13 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Student List Fetched successfully\",\n    \"students\": [\n        {\n            \"previousMentors\": [],\n            \"_id\": \"66571af001359215f8c71174\",\n            \"name\": \"Luffy\",\n            \"email\": \"kingofpirates@onepiece.com\",\n            \"batch\": \"anime\",\n            \"__v\": 0,\n            \"mentId\": \"665716d86eebd693694b38a2\"\n        },\n        {\n            \"previousMentors\": [],\n            \"_id\": \"66571b2301359215f8c71176\",\n            \"name\": \"Shanks\",\n            \"email\": \"kingmaker@onepiece.com\",\n            \"batch\": \"anime\",\n            \"__v\": 0,\n            \"mentId\": \"665716d86eebd693694b38a2\"\n        }\n    ]\n}"}],"_postman_id":"5f17aa44-89c0-4968-a77b-0972d49bb299"},{"name":"Previous Mentor","id":"58736e71-e925-452d-8895-5711d19a5be8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:4000/api/mentor/previous-mentors/66571bbc01359215f8c7117c","description":"<h4 id=\"previous-mentor\">Previous Mentor</h4>\n<p><strong>URL</strong>: <code>/api/mentor/previous-mentors/:id</code></p>\n<p><strong>Description</strong>: Retrieves and displays the list of previous mentors for a specific student.</p>\n<p><strong>Method</strong>: GET</p>\n<p><strong>Example</strong>:</p>\n<p><code>http://localhost:4000/api/mentor/previous-mentors/66571bbc01359215f8c7117c</code></p>\n","urlObject":{"protocol":"http","port":"4000","path":["api","mentor","previous-mentors","66571bbc01359215f8c7117c"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"947bf504-aaa1-478f-ab2e-8ee1e1e84437","name":"Previous Mentor","originalRequest":{"method":"GET","header":[],"url":"http://localhost:4000/api/mentor/previous-mentors/66571bbc01359215f8c7117c"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"128"},{"key":"ETag","value":"W/\"80-edvFuFeANk5I4H/eK3LHktrwJRA\""},{"key":"Date","value":"Wed, 29 May 2024 14:14:39 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"previousMentors\": [\n        {\n            \"_id\": \"665719d090123c0986bbff2a\",\n            \"name\": \"Kakashi\",\n            \"email\": \"copyninja@naruto.com\",\n            \"batch\": \"anime\",\n            \"__v\": 0\n        }\n    ]\n}"}],"_postman_id":"58736e71-e925-452d-8895-5711d19a5be8"}]}