{"info":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","description":"<html><head></head><body><p>This API let a user create as many tasks as he/she wants and then store all those tasks in user's account from where the user can fetch, update and delete the tasks anytime the user wants.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"14623339","collectionId":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","publishedId":"Uz5FLHDf","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2022-06-02T13:12:57.000Z"},"item":[{"name":"Users","item":[{"name":"Get Authenticated User","id":"da7bb037-4ba9-47fc-9f75-04bb893bcfb4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{url}}/users/me","description":"<p>Here, in this route, the user can fetch all the information regarding his/her profile after login/signup.</p>\n","urlObject":{"path":["users","me"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"da7bb037-4ba9-47fc-9f75-04bb893bcfb4"},{"name":"Signup User","event":[{"listen":"test","script":{"id":"339a1714-649e-4f36-b40e-c11880129d81","exec":["if (pm.response.code === 201) {\r","    pm.environment.set('authToken', pm.response.json().newToken);\r","}"],"type":"text/javascript"}}],"id":"c579e978-ca92-4f3d-aef7-f21843d916b9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Som\",\r\n    \"email\": \"som@gmail.com\",\r\n    \"password\": \"  1234567 \"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/users","description":"<p>Here, in this route, a brand new user will be able to register for a new account.</p>\n","urlObject":{"path":["users"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"c579e978-ca92-4f3d-aef7-f21843d916b9"},{"name":"login user","event":[{"listen":"prerequest","script":{"id":"1cff885d-1137-41ab-a58c-9a3fbe357070","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"65d1ffa9-197f-4e11-9ed9-169b36e70d90","exec":["if (pm.response.code === 200) {\r","    pm.environment.set('authToken', pm.response.json().newToken);\r","}"],"type":"text/javascript"}}],"id":"1c56b4c5-cb1b-40a3-a6ee-5e18e258a3bf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\" : \"som@gmail.com\",\r\n    \"password\": \"1234567\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/users/login","description":"<p>Here, in this route, the user who has already created an account will be able to login using emailID and password.</p>\n","urlObject":{"path":["users","login"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"1c56b4c5-cb1b-40a3-a6ee-5e18e258a3bf"},{"name":"Update User","id":"bab9eef9-61bf-4dc3-9cd2-afe021044c52","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"age\" : 27,\r\n    \"name\" : \"som2updated\",\r\n    \"password\" : \"1234567\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/users/me","description":"<p>Here, in this route, the user will be able to update his/her profile.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}},"urlObject":{"path":["users","me"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"bab9eef9-61bf-4dc3-9cd2-afe021044c52"},{"name":"profile pic upload by user","id":"1376edb8-604a-4383-af18-98016653bf96","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"avatar","type":"file","src":"/C:/Users/Somenath/OneDrive/Desktop/web_development/nodejs by andrew mead/d) task app/d) file uploads/01) adding supports for file uploads/node-course-images/profile-pic.jpg"}]},"url":"{{url}}/users/me/avatar","description":"<p>Here, in this route, the user will be able to upload a profile pic of himself/herself.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}},"urlObject":{"path":["users","me","avatar"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"1376edb8-604a-4383-af18-98016653bf96"},{"name":"delete profile pic by user","id":"475353ad-3274-422f-8ffb-a2f203f248bc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"{{url}}/users/me/avatar","description":"<p>Here, in this route, the user will be able to delete his/her profile pic.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}},"urlObject":{"path":["users","me","avatar"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"475353ad-3274-422f-8ffb-a2f203f248bc"},{"name":"Delete User","id":"a3303e46-27bd-4e2e-9606-370a420ae572","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"{{url}}/users/me","description":"<p>Here, in this route, the user will be able to delete his/her account.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}},"urlObject":{"path":["users","me"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a3303e46-27bd-4e2e-9606-370a420ae572"},{"name":"logout user","id":"9863da5c-bf95-4cbd-b2e0-5a7a2debca6e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"{{url}}/users/logout","description":"<p>Here, in this route, the user will be able to logout from his/her account.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}},"urlObject":{"path":["users","logout"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"9863da5c-bf95-4cbd-b2e0-5a7a2debca6e"},{"name":"logout user from all sessions","id":"0db2e711-4219-4440-ad5f-dd4d0bf963b4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"{{url}}/users/logoutAll","description":"<p>Here, in this route, the user will be able to logout from all the sessions.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}},"urlObject":{"path":["users","logoutAll"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"0db2e711-4219-4440-ad5f-dd4d0bf963b4"}],"id":"f76c68f7-aa36-4fa7-aa11-932f635b9544","description":"<p>This section is all about creating account, login, update user profile, authentication, logout.</p>\n","_postman_id":"f76c68f7-aa36-4fa7-aa11-932f635b9544","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}}},{"name":"Tasks","item":[{"name":"Get all Tasks","id":"dda6869c-0472-4219-aad2-10120e6186fd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/tasks","description":"<p>Here, in this route, the user will be able to fetch all the tasks he/she has created.</p>\n<p><strong>NOTE:-</strong></p>\n<ol>\n<li><p>In order to get only completed tasks, write the query:- <code>/tasks?completed=true</code></p>\n</li>\n<li><p>In order to get only incompleted tasks, write the query:- <code>/tasks?completed=false</code></p>\n</li>\n<li><p>If the user wants to use the pagination feature, then he/she can do that by writing query like this:- <code>/tasks?limit=10&amp;skip=10</code></p>\n</li>\n<li><p>If the user wants to sort data in ascending order or descending order w.r.t <em><strong>createdAt,</strong></em> then, he or she can do that by writing the following queries :-</p>\n</li>\n</ol>\n<p>a) In order to sort the data in ascending order w.r.t <em><strong>createdAt</strong></em>, the user will have to write =&gt; <code>/tasks? sortBy=createdAt:asc</code></p>\n<p>b) In order to sort the data in descending order w.r.t <em><strong>createdAt</strong></em>, the user will have to write =&gt; <code>/tasks?sortBy=createdAt:desc</code></p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}},"urlObject":{"path":["tasks"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"dda6869c-0472-4219-aad2-10120e6186fd"},{"name":"Getting a particular task by Id","id":"2183f4f5-be36-4646-8ec2-daf772ad1032","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/tasks/62962c0f24b91bee866aab76","description":"<p>Here, the user will be able to fetch any particular task that he/she has created with the help of that task's ID.</p>\n<p><strong>NOTE</strong>:- The user will not be able to fetch any other user's task by its ID.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}},"urlObject":{"path":["tasks","62962c0f24b91bee866aab76"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"2183f4f5-be36-4646-8ec2-daf772ad1032"},{"name":"Create Task","id":"08ee19d0-8ffe-4758-b202-bb2c1f8114db","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"description\": \"second task of som\",\r\n    \"completed\": false\r\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/tasks","description":"<p>Here, in this route, the user will be able to create a brand new task.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}},"urlObject":{"path":["tasks"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"08ee19d0-8ffe-4758-b202-bb2c1f8114db"},{"name":"Update a particular task by Id","id":"243668e2-afb9-4919-bf83-b96b65f76100","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"description\" : \"finish typescript course\",\r\n    \"completed\" : \"false\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/tasks/62964180bf33f1217e0b89c6","description":"<p>Here, in this route, the user will be able to update any particular task created by him/her by that task's ID.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}},"urlObject":{"path":["tasks","62964180bf33f1217e0b89c6"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"243668e2-afb9-4919-bf83-b96b65f76100"},{"name":"Delete Task","id":"94e9b43b-a7d1-4ec7-adbf-7fc30b015475","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"{{url}}/tasks/62970ce2f916917dbe868f3c","description":"<p>Here, in this route, the user will be able to delete any task created by him/her by that task's ID.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}},"urlObject":{"path":["tasks","62970ce2f916917dbe868f3c"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"94e9b43b-a7d1-4ec7-adbf-7fc30b015475"}],"id":"8650feea-22ff-4b91-a715-e079f9032359","description":"<p>This section is all about creating, fetching, updating and deleting tasks.</p>\n","_postman_id":"8650feea-22ff-4b91-a715-e079f9032359","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]},"isInherited":true,"source":{"_postman_id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","id":"b59799e6-a1aa-404d-8d7a-605a5a2e4e34","name":"Nodejs Task App API Docs","type":"collection"}}}],"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{authToken}}"}]}},"event":[{"listen":"prerequest","script":{"id":"217d1012-22b1-45bc-8010-ef8530a53402","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"ba1fe6a5-250b-474b-a63a-4a311b9e1372","type":"text/javascript","exec":[""]}}]}