{"info":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","description":"<html><head></head><body><p>Task manager REST API with user accounts and authentication</p>\n<p><a href=\"https://task-manager-restapi.up.railway.app/\">https://task-manager-restapi.up.railway.app/</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"8858694","collectionId":"dbcfdd50-3808-4b94-b441-22cad2277591","publishedId":"2s8ZDVb4HT","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2023-01-18T16:06:51.000Z"},"item":[{"name":"Create User with Credentials","event":[{"listen":"test","script":{"id":"19a1db15-0681-46d1-9f84-ffa854e25850","exec":["if (pm.response.code === 201) {","    pm.environment.set('tokenAuth', pm.response.json().token)","}"],"type":"text/javascript"}}],"id":"7d6cf4b2-ada7-43a4-bc9a-00508d324ed7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"camillacab@hotmail.com\",\n    \"password\": \"iloveasianfood\",\n    \"name\": \"Camila Real\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/users","description":"<p>Create a new user with email and password.</p>\n<p>Name is required.</p>\n<p>An welcome email is sent to the new user.</p>\n","urlObject":{"path":["users"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"2b8ed7ff-a3b0-4568-b86b-df1b6542fd92","name":"Successful Response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"camillacab@hotmail.com\",\n    \"password\": \"iloveasianfood\",\n    \"name\": \"Camila Real\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/users"},"status":"Created","code":201,"_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":"343"},{"key":"ETag","value":"W/\"157-X0FtjhbHFejoOiJXb4AoCDp5jXI\""},{"key":"Date","value":"Wed, 18 Jan 2023 18:55:01 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"user\": {\n        \"age\": 0,\n        \"_id\": \"63c84085c921c6bb6a972bd4\",\n        \"email\": \"test@email.com\",\n        \"name\": \"Camila Test\",\n        \"createdAt\": \"2023-01-18T18:55:01.279Z\",\n        \"updatedAt\": \"2023-01-18T18:55:01.279Z\",\n        \"__v\": 0\n    },\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2M2M4NDA4NWM5MjFjNmJiNmE5NzJiZDQiLCJpYXQiOjE2NzQwNjgxMDF9.hTCQCu_gBOmAV5LKfhBDyEDNwIW76HYX5y1_NBmgnPA\"\n}"},{"id":"191cfacc-73c0-4b28-bc39-c564a1718165","name":"Unsuccessfull Response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"tes2@hotmail.com\",\n    \"password\": \"thisismypassword\",\n    \"name\": \"John Doe\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/users"},"status":"Bad Request","code":400,"_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":"658"},{"key":"ETag","value":"W/\"292-9kNnklvZ2d/q/QUmf0BSKf4CVb4\""},{"key":"Date","value":"Thu, 19 Jan 2023 22:59:38 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"errors\": {\n        \"password\": {\n            \"name\": \"ValidatorError\",\n            \"message\": \"Password must not include \\\"password\\\"\",\n            \"properties\": {\n                \"message\": \"Password must not include \\\"password\\\"\",\n                \"type\": \"user defined\",\n                \"path\": \"password\",\n                \"value\": \"thisismypassword\",\n                \"reason\": {\n                    \"generatedMessage\": false,\n                    \"code\": \"ERR_ASSERTION\",\n                    \"actual\": false,\n                    \"expected\": true,\n                    \"operator\": \"==\"\n                }\n            },\n            \"kind\": \"user defined\",\n            \"path\": \"password\",\n            \"value\": \"thisismypassword\",\n            \"reason\": {\n                \"generatedMessage\": false,\n                \"code\": \"ERR_ASSERTION\",\n                \"actual\": false,\n                \"expected\": true,\n                \"operator\": \"==\"\n            }\n        }\n    },\n    \"_message\": \"User validation failed\",\n    \"name\": \"ValidationError\",\n    \"message\": \"User validation failed: password: Password must not include \\\"password\\\"\"\n}"}],"_postman_id":"7d6cf4b2-ada7-43a4-bc9a-00508d324ed7"},{"name":"Get User Profile","id":"070f77d7-9aaf-4a9a-ac86-cd564adb4238","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/users/me","description":"<p>Get User Profile Details (email &amp; name) for Profile Page.</p>\n<p>(token required)</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["users","me"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"95f8d411-fd9a-4080-bdb8-0448697a6473","name":"Successful Response","originalRequest":{"method":"GET","header":[{"key":"Authentication","type":"text","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZjlmNzI2ZjNkN2Q5NzFkZmExZjViODEiLCJpYXQiOjE2MDQzNTMzMTJ9.AxKZboR330Sn7npE3qWzgPB4jPrhRefoymQlEJNjktY","disabled":true}],"url":"{{url}}/users/me"},"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":"182"},{"key":"ETag","value":"W/\"b6-V6lc0AMkPJcfarxZqKYN0GMjQPU\""},{"key":"Date","value":"Thu, 19 Jan 2023 23:07:07 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"age\": 0,\n    \"_id\": \"63c9ca005254cc7e9ccf7797\",\n    \"email\": \"camillacab@hotmail.com\",\n    \"name\": \"Camila Real\",\n    \"createdAt\": \"2023-01-19T22:53:52.983Z\",\n    \"updatedAt\": \"2023-01-19T22:53:53.135Z\",\n    \"__v\": 1\n}"}],"_postman_id":"070f77d7-9aaf-4a9a-ac86-cd564adb4238"},{"name":"Get Single User Avatar","id":"d994c53b-bdd6-4d6c-87e4-cc0c0449186b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/users/63c9ca005254cc7e9ccf7797/avatar","description":"<p>Get Single User avatar by ID</p>\n<p>{{url}}/users/:id/avatar</p>\n<p>'Content-Type', 'image/jpg'</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["users","63c9ca005254cc7e9ccf7797","avatar"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"8cade46d-a4a1-46ce-9c17-4dc0d7c2620f","name":"Response when user has not uploaded avatar yet","originalRequest":{"method":"GET","header":[],"url":"{{url}}/users/63c9ca005254cc7e9ccf7797/avatar"},"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":"33"},{"key":"ETag","value":"W/\"21-A+zll+yFQuxxxWIOOz25OXbzUIE\""},{"key":"Date","value":"Thu, 19 Jan 2023 23:48:04 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"No avatar image found\"\n}"}],"_postman_id":"d994c53b-bdd6-4d6c-87e4-cc0c0449186b"},{"name":"Update Autenticated User Profile","id":"9447bcc1-85f9-41d5-b23c-8be548949e09","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"Joanne\",\n    \"email\": \"gaga@gmail.com\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/users/me","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["users","me"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"2659e1ea-ad1e-4f2b-891b-2bf47bb7624f","name":"Successful Response","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"Joanne\",\n    \"email\": \"gaga@gmail.com\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/users/me"},"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":"169"},{"key":"ETag","value":"W/\"a9-f34OfpiPVPzaCYF46KMOQGqRvcs\""},{"key":"Date","value":"Fri, 20 Jan 2023 00:11:11 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"age\": 0,\n    \"_id\": \"63c84085c921c6bb6a972bd4\",\n    \"email\": \"gaga@gmail.com\",\n    \"name\": \"Joanne\",\n    \"createdAt\": \"2023-01-18T18:55:01.279Z\",\n    \"updatedAt\": \"2023-01-20T00:11:11.910Z\",\n    \"__v\": 4\n}"}],"_postman_id":"9447bcc1-85f9-41d5-b23c-8be548949e09"},{"name":"Login User with Email and Password","event":[{"listen":"test","script":{"id":"2e82163d-eeab-4a37-bafc-8092d7d21a31","exec":["if (pm.response.code == 200) {","    pm.environment.set('tokenAuth', pm.response.json().token)","}"],"type":"text/javascript"}}],"id":"93a70142-b214-4fef-a767-2d358502c72a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"test@email.com\",\n    \"password\": \"mycodeisawesome\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/users/login","description":"<p>Email and Password are required.</p>\n<p>JWT is created and send to the client if login is succesfull.</p>\n","urlObject":{"path":["users","login"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"135b46c3-ee83-4833-aaf9-ad44dfe12d54","name":"Successful Response","originalRequest":{"method":"POST","header":[{"key":"Authentication","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2M2M4NDA4NWM5MjFjNmJiNmE5NzJiZDQiLCJpYXQiOjE2NzQwNjgxMDF9.hTCQCu_gBOmAV5LKfhBDyEDNwIW76HYX5y1_NBmgnPA","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\n    \"email\": \"test@email.com\",\n    \"password\": \"mycodeisawesome\"\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/users/login"},"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":"343"},{"key":"ETag","value":"W/\"157-SGGVY2DUT3dEtfi74TCIJWIMXWY\""},{"key":"Date","value":"Wed, 18 Jan 2023 19:00:41 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"user\": {\n        \"age\": 0,\n        \"_id\": \"63c84085c921c6bb6a972bd4\",\n        \"email\": \"test@email.com\",\n        \"name\": \"Camila Test\",\n        \"createdAt\": \"2023-01-18T18:55:01.279Z\",\n        \"updatedAt\": \"2023-01-18T18:57:27.087Z\",\n        \"__v\": 2\n    },\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2M2M4NDA4NWM5MjFjNmJiNmE5NzJiZDQiLCJpYXQiOjE2NzQwNjg0NDF9.0X8Q135M1HqbFO2xH9mSayZCofiAo-6PbOgsleqmif0\"\n}"}],"_postman_id":"93a70142-b214-4fef-a767-2d358502c72a"},{"name":"Logout User","id":"d98376ca-f7d2-4cf9-9390-2af606c4f4c8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"{{url}}/users/logout","description":"<p>Filter out current token being used from the user's token array in the DB.</p>\n<p>Log out user</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["users","logout"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"d98376ca-f7d2-4cf9-9390-2af606c4f4c8"},{"name":"Logout From All","id":"d5b85ad0-2470-4c0a-a7f9-3d68f3c570aa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"{{url}}/users/logoutall","description":"<p>Erase user's array of tokens in the DB.</p>\n<p>User is log out from all devices (browers)</p>\n<p>' req.user.tokens = [];'</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["users","logoutall"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"d5b85ad0-2470-4c0a-a7f9-3d68f3c570aa"},{"name":"Delete User Profile","id":"0a84a51e-c8fe-4f5b-abfb-ffdfd6d1ffe9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"{{url}}/users/me","description":"<p>Delete user's data from the DB</p>\n<p>A cancelation email is sent.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["users","me"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"0a84a51e-c8fe-4f5b-abfb-ffdfd6d1ffe9"},{"name":"Upload User Avatar","id":"0f92c5f9-7540-4fa7-9b53-6499ee63d4d4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"avatar","type":"file","src":"/Users/camilabarros/Downloads/camilab.png"},{"key":"","type":"file","value":null,"disabled":true}]},"url":"{{url}}/users/me/avatar","description":"<p>Upload avatar image using Multer</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["users","me","avatar"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"0f92c5f9-7540-4fa7-9b53-6499ee63d4d4"},{"name":"Get User Avatar","id":"a6a4213c-0a4f-4cf4-9427-173d2da30fe7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/users/me/avatar","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["users","me","avatar"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"a6a4213c-0a4f-4cf4-9427-173d2da30fe7"},{"name":"Get User Avatar By ID","id":"d499ee4f-bd41-4aa7-b685-8d1420603ff5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/users/:id/avatar","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["users",":id","avatar"],"host":["{{url}}"],"query":[],"variable":[{"type":"any","value":null,"key":"id"}]}},"response":[],"_postman_id":"d499ee4f-bd41-4aa7-b685-8d1420603ff5"},{"name":"Deletes User Avatar","id":"86d29f80-a286-4246-b6bc-58c08e751dea","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"{{url}}/users/me/avatar","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["users","me","avatar"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"86d29f80-a286-4246-b6bc-58c08e751dea"},{"name":"Create Task","id":"cc8f41f8-1d89-45a2-8aba-939acebaad13","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n   \"description\": \"Play videogame\",\n   \"completed\": false\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/tasks","description":"<p>Create Task for User SignedIn.</p>\n<p>Description and completed (boolean) are required.</p>\n<p>Owner of the task is assigned automatically by using token sent with the request.</p>\n","urlObject":{"path":["tasks"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"7c18748d-0501-449e-bccd-0c1c4f5a1c4b","name":"Successful Response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n   \"description\": \"Take the dog for an walk\",\n   \"completed\": false\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/tasks"},"status":"Created","code":201,"_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":"214"},{"key":"ETag","value":"W/\"d6-uqOcROMgDjHB47KD7aT/InS6RB4\""},{"key":"Date","value":"Thu, 19 Jan 2023 23:02:49 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"completed\": false,\n    \"_id\": \"63c9cc185254cc7e9ccf779d\",\n    \"description\": \"Take the dog for an walk\",\n    \"owner\": \"63c9ca005254cc7e9ccf7797\",\n    \"createdAt\": \"2023-01-19T23:02:48.996Z\",\n    \"updatedAt\": \"2023-01-19T23:02:48.996Z\",\n    \"__v\": 0\n}"},{"id":"7d190d78-2816-4b82-b7fe-1b5c0fd24123","name":"Unsuccessful Response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n   \"description\": \"\",\n   \"completed\": false\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/tasks"},"status":"Bad Request","code":400,"_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":"397"},{"key":"ETag","value":"W/\"18d-Aj9O64HMdNMerBaS1Q4sK8f9VGg\""},{"key":"Date","value":"Thu, 19 Jan 2023 23:05:28 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"errors\": {\n        \"description\": {\n            \"name\": \"ValidatorError\",\n            \"message\": \"Path `description` is required.\",\n            \"properties\": {\n                \"message\": \"Path `description` is required.\",\n                \"type\": \"required\",\n                \"path\": \"description\",\n                \"value\": \"\"\n            },\n            \"kind\": \"required\",\n            \"path\": \"description\",\n            \"value\": \"\"\n        }\n    },\n    \"_message\": \"Task validation failed\",\n    \"name\": \"ValidationError\",\n    \"message\": \"Task validation failed: description: Path `description` is required.\"\n}"}],"_postman_id":"cc8f41f8-1d89-45a2-8aba-939acebaad13"},{"name":"Get Taks for Authenticated User","id":"329dd576-0e44-42e1-87ea-8dbad95c651c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/tasks?limit=10?skip=1","description":"<p>Get all taks for authenticated user.</p>\n<p>Token required</p>\n<p>Accepts query parameters:</p>\n<ul>\n<li>completed</li>\n<li>limit</li>\n<li>sortBy</li>\n</ul>\n<p>Examples:</p>\n<p>// GET: /tasks?completed=true</p>\n<p>// GET: /tasks?limit=10?skip=20</p>\n<p>//GET /tasks?sortBy=createdAt:desc</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["tasks"],"host":["{{url}}"],"query":[{"key":"limit","value":"10?skip=1"}],"variable":[]}},"response":[{"id":"4aac62a3-55df-41de-b77f-b2125389e800","name":"Successful Response (with query params)","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{url}}/tasks?limit=10?skip=1","host":["{{url}}"],"path":["tasks"],"query":[{"key":"limit","value":"10?skip=1"}]}},"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":"426"},{"key":"ETag","value":"W/\"1aa-k3+70z3d+oXVZ9ryxfkYwGoX9qk\""},{"key":"Date","value":"Thu, 19 Jan 2023 23:51:27 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"completed\": false,\n        \"_id\": \"63c9cc185254cc7e9ccf779d\",\n        \"description\": \"Take the dog for an walk\",\n        \"owner\": \"63c9ca005254cc7e9ccf7797\",\n        \"createdAt\": \"2023-01-19T23:02:48.996Z\",\n        \"updatedAt\": \"2023-01-19T23:02:48.996Z\",\n        \"__v\": 0\n    },\n    {\n        \"completed\": false,\n        \"_id\": \"63c9cd065254cc7e9ccf77a2\",\n        \"description\": \"Code review meeting\",\n        \"owner\": \"63c9ca005254cc7e9ccf7797\",\n        \"createdAt\": \"2023-01-19T23:06:46.494Z\",\n        \"updatedAt\": \"2023-01-19T23:06:46.494Z\",\n        \"__v\": 0\n    }\n]"}],"_postman_id":"329dd576-0e44-42e1-87ea-8dbad95c651c"},{"name":"Get Single Task By ID","id":"55cf15f1-2cab-4661-b784-2cf95d5314f9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/tasks/63c9cc185254cc7e9ccf779d","description":"<p>{{url}}/tasks/:id</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["tasks","63c9cc185254cc7e9ccf779d"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"2ad07a1a-a346-48ff-95b8-d0bfd9545f08","name":"Successful Response","originalRequest":{"method":"GET","header":[],"url":"{{url}}/tasks/63c9cc185254cc7e9ccf779d"},"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":"214"},{"key":"ETag","value":"W/\"d6-uqOcROMgDjHB47KD7aT/InS6RB4\""},{"key":"Date","value":"Thu, 19 Jan 2023 23:53:47 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"completed\": false,\n    \"_id\": \"63c9cc185254cc7e9ccf779d\",\n    \"description\": \"Take the dog for an walk\",\n    \"owner\": \"63c9ca005254cc7e9ccf7797\",\n    \"createdAt\": \"2023-01-19T23:02:48.996Z\",\n    \"updatedAt\": \"2023-01-19T23:02:48.996Z\",\n    \"__v\": 0\n}"}],"_postman_id":"55cf15f1-2cab-4661-b784-2cf95d5314f9"},{"name":"Update Task By ID","id":"7dc858c6-8c2b-469c-8f62-fa27c8b21a08","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"completed\": true\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/tasks/63c9dd6da7f7399d696d5197","description":"<p>allowedFields = ['description', 'completed']</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["tasks","63c9dd6da7f7399d696d5197"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[{"id":"bcba8611-2529-45a5-870f-86af1f44f622","name":"Successful Response","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"completed\": true\n}","options":{"raw":{"language":"json"}}},"url":"{{url}}/tasks/63c9dd6da7f7399d696d5197"},"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":"203"},{"key":"ETag","value":"W/\"cb-YOcqzQ4RZcO4td8XME3d6jqcBsg\""},{"key":"Date","value":"Fri, 20 Jan 2023 00:17:36 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"completed\": true,\n    \"_id\": \"63c9dd6da7f7399d696d5197\",\n    \"description\": \"Play videogame\",\n    \"owner\": \"63c9dd5ca7f7399d696d5192\",\n    \"createdAt\": \"2023-01-20T00:16:45.825Z\",\n    \"updatedAt\": \"2023-01-20T00:17:36.276Z\",\n    \"__v\": 0\n}"}],"_postman_id":"7dc858c6-8c2b-469c-8f62-fa27c8b21a08"},{"name":"Delete Task by ID","id":"fdeda0c7-fcdd-4ebf-8658-f6c847771fe2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"{{url}}/tasks/5fa5d284fe6b011a5d2d5043","description":"<p>Removes task from user's taks collection.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]},"isInherited":true,"source":{"_postman_id":"dbcfdd50-3808-4b94-b441-22cad2277591","id":"dbcfdd50-3808-4b94-b441-22cad2277591","name":"Task Management App","type":"collection"}},"urlObject":{"path":["tasks","5fa5d284fe6b011a5d2d5043"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"fdeda0c7-fcdd-4ebf-8658-f6c847771fe2"}],"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{tokenAuth}}"}]}},"event":[{"listen":"prerequest","script":{"id":"f300716e-ea30-4d4b-b5ef-2be60fbaa414","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"b264532a-9258-40fe-8c68-35dcc3dc91b1","type":"text/javascript","exec":[""]}}]}