{"info":{"_postman_id":"0afd74ca-bf59-441f-a57f-5a650a3f9951","name":"chatAPI","description":"<html><head></head><body><h3 id=\"notes--\">Notes -</h3>\n<ul>\n<li>The _id field of user in both collection(users and auths) are implemented to be always same!</li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"15604030","collectionId":"0afd74ca-bf59-441f-a57f-5a650a3f9951","publishedId":"TzRRC8bB","public":true,"customColor":{"top-bar":"303030","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-05-07T12:48:43.000Z"},"item":[{"name":"userAPI","item":[{"name":"Create a new user","id":"787e35d4-53fb-4780-979f-470a07fc597e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"firstName\": \"Bertholt\",\n    \"lastName\": \"bertoloto\",\n    \"phoneNumber\": \"789323970\",\n    \"userType\": \"consuMer\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users/","description":"<p>It creates a new user if the body is validated. The validation paramerters are -</p>\n<ul>\n<li>First name and last nam should be non empty strings</li>\n<li>Phone number should me 10 digit numeric string.</li>\n<li>User type should be either consumer or developer, case insensetive</li>\n</ul>\n","urlObject":{"protocol":"http","port":"3000","path":["users",""],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"f0626259-ecd9-47f7-bfdf-763704a2c6f8","name":"Create a new user - Successful, status[200]","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"firstName\": \"Bertholt\",\n    \"lastName\": \"bertoloto\",\n    \"phoneNumber\": \"7893233970\",\n    \"userType\": \"consuMer\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"247"},{"key":"ETag","value":"W/\"f7-h6G2ObjJvnaTwYF5z89F6+dp//8\""},{"key":"Date","value":"Thu, 06 May 2021 14:35:33 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"user\": {\n        \"firstName\": \"bertholt\",\n        \"lastName\": \"bertoloto\",\n        \"phoneNumber\": \"7893233970\",\n        \"userType\": \"CONSUMER\",\n        \"_id\": \"c927d7d7d0e34f1cab24d0a0c692c12e\",\n        \"createdAt\": \"2021-05-06T14:35:33.418Z\",\n        \"updatedAt\": \"2021-05-06T14:35:33.418Z\",\n        \"__v\": 0\n    }\n}"},{"id":"98fc949e-24b1-49cd-ab48-d537a13e9cec","name":"Create a new user - Bad resquest , status[400]","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"firstName\": \"Bertholt\",\n    \"lastName\": \"bertoloto\",\n    \"phoneNumber\": \"789323970\",\n    \"userType\": \"consuMer\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users/"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"103"},{"key":"ETag","value":"W/\"67-q/UusePxHR8P4KXSijPwuB1qUII\""},{"key":"Date","value":"Fri, 07 May 2021 04:23:28 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"value\": \"789323970\",\n            \"msg\": \"Invalid phone number\",\n            \"param\": \"phoneNumber\",\n            \"location\": \"body\"\n        }\n    ]\n}"},{"id":"64a04367-48d5-408d-aa20-de107df4e273","name":"Create a new user - internal server error[500]","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"firstName\": \"Bertholt\",\n    \"lastName\": \"bertoloto\",\n    \"phoneNumber\": \"7893233970\",\n    \"userType\": \"consuMer\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users/"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"75"},{"key":"ETag","value":"W/\"4b-cWz3bCTlHbstBu13WEPTjI09clE\""},{"key":"Date","value":"Fri, 07 May 2021 04:25:28 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"message\": \"This phone number is already in use\"\n    }\n}"}],"_postman_id":"787e35d4-53fb-4780-979f-470a07fc597e"},{"name":"Get user By id","id":"7c75ea6d-d5cb-461c-872d-8aa044f59e01","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/users/id/c927d7d7d0e34f1cab24d0a0c692c12e","description":"<p>Search a user by its id.\nFormat - <code>http://localhost:3000/users/id/:id</code></p>\n","urlObject":{"protocol":"http","port":"3000","path":["users","id","c927d7d7d0e34f1cab24d0a0c692c12e"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"0610e1b7-0f82-47cd-965e-bfa7632be29d","name":"Get user By id - Success, status[200]","originalRequest":{"method":"GET","header":[],"url":"http://localhost:3000/users/id/c927d7d7d0e34f1cab24d0a0c692c12e"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"247"},{"key":"ETag","value":"W/\"f7-0vgVhK8bOnyu7QSKGuiUAHoWKmU\""},{"key":"Date","value":"Fri, 07 May 2021 04:27:30 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"user\": {\n        \"_id\": \"c927d7d7d0e34f1cab24d0a0c692c12e\",\n        \"firstName\": \"bertholt\",\n        \"lastName\": \"bertoloto\",\n        \"phoneNumber\": \"7893233970\",\n        \"userType\": \"CONSUMER\",\n        \"createdAt\": \"2021-05-06T14:35:33.418Z\",\n        \"updatedAt\": \"2021-05-06T14:35:33.418Z\",\n        \"__v\": 0\n    }\n}"},{"id":"8804e066-0f78-416d-b258-25a482f6aa00","name":"Get user By id - Internal server error, status[500]","originalRequest":{"method":"GET","header":[],"url":"http://localhost:3000/users/id/c927d7d7d0e34f1cab24d0a0c"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"72"},{"key":"ETag","value":"W/\"48-G9HpPgGZE/FRtwer9fnpStV1J+Y\""},{"key":"Date","value":"Fri, 07 May 2021 04:31:06 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"message\": \"No such user exists with this id\"\n    }\n}"}],"_postman_id":"7c75ea6d-d5cb-461c-872d-8aa044f59e01"},{"name":"Delete user by id","id":"d744e90f-58d7-4529-8eea-abb8d7ea37d3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:3000/users/id/c927d7d7d0e34f1cab24d0a0c692c12e","description":"<p>Deletes a user by its id. Response indicates how many users are deleted(it will delete only one user as id is unique field)</p>\n<ul>\n<li>Format - <code>http://localhost:3000/users/id/:id</code></li>\n</ul>\n","urlObject":{"protocol":"http","port":"3000","path":["users","id","c927d7d7d0e34f1cab24d0a0c692c12e"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"67f9dc0d-fae4-47f9-bf5c-de14dd107220","name":"Delete user by id","originalRequest":{"method":"DELETE","header":[],"url":"http://localhost:3000/users/id/c927d7d7d0e34f1cab24d0a0c692c12e"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"58"},{"key":"ETag","value":"W/\"3a-NPoDmHSP8Pm+mIWrQpP4fFQzHmA\""},{"key":"Date","value":"Fri, 07 May 2021 04:42:22 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": {\n        \"n\": 1,\n        \"ok\": 1,\n        \"deletedCount\": 1\n    }\n}"}],"_postman_id":"d744e90f-58d7-4529-8eea-abb8d7ea37d3"},{"name":"Get a user by phone number","id":"bacf8c83-66d8-4658-838d-5091482c573e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/users/phone/78980889","description":"<p>Searches and returns a user by its phone number if it exists.Since phone number is unique so always returns one user it exists.</p>\n<ul>\n<li>Format - <code>http://localhost:3000/users/phone/:number</code></li>\n</ul>\n","urlObject":{"protocol":"http","port":"3000","path":["users","phone","78980889"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"9691ca2c-2492-477a-a1be-118c112474b6","name":"Get a user by phone number - success[200]","originalRequest":{"method":"GET","header":[],"url":"http://localhost:3000/users/phone/7898088970"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"239"},{"key":"ETag","value":"W/\"ef-BtiFi9co0tfEVvQ82U5A2NzA4MI\""},{"key":"Date","value":"Fri, 07 May 2021 04:44:00 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"user\": {\n        \"_id\": \"f25b952207cd4802bcf1292712f2bba3\",\n        \"firstName\": \"dina\",\n        \"lastName\": \"fritz\",\n        \"phoneNumber\": \"7898088970\",\n        \"userType\": \"CONSUMER\",\n        \"createdAt\": \"2021-05-06T14:35:05.433Z\",\n        \"updatedAt\": \"2021-05-06T14:35:05.433Z\",\n        \"__v\": 0\n    }\n}"},{"id":"fcd8d183-33c0-4a66-96b3-0324752ad68e","name":"Bad request - [400]","originalRequest":{"method":"GET","header":[],"url":"http://localhost:3000/users/phone/789808897"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"100"},{"key":"ETag","value":"W/\"64-qPKcONsuuGOzG307GS6CAp+ytpE\""},{"key":"Date","value":"Fri, 07 May 2021 04:46:28 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"value\": \"789808897\",\n            \"msg\": \"Invalid phone number\",\n            \"param\": \"number\",\n            \"location\": \"params\"\n        }\n    ]\n}"},{"id":"230688a2-d577-4e1f-b1f0-cbeff2c9acf8","name":"Internal server error - [500]","originalRequest":{"method":"GET","header":[],"url":"http://localhost:3000/users/phone/7898088972"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"82"},{"key":"ETag","value":"W/\"52-l46UMW9kmV6Dk4rANoEKX2DRLOw\""},{"key":"Date","value":"Fri, 07 May 2021 04:46:58 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"message\": \"No such user exists with this phone number\"\n    }\n}"}],"_postman_id":"bacf8c83-66d8-4658-838d-5091482c573e"},{"name":"Delete user by phone number","id":"c69f7440-c829-4299-9077-5c4418a13330","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:3000/users/phone/8718802016","description":"<p>Deletes user if exists by phone number. First validates phone number.</p>\n<ul>\n<li>Format - <code>http://localhost:3000/users/phone/:number</code></li>\n</ul>\n","urlObject":{"protocol":"http","port":"3000","path":["users","phone","8718802016"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"9f078b7e-bd7b-4bb5-bb00-e84257dc413e","name":"Request  success [ 200 ]","originalRequest":{"method":"DELETE","header":[],"url":"http://localhost:3000/users/phone/8789687683"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"58"},{"key":"ETag","value":"W/\"3a-R8aQod/zq8dMlqer8zDj9zBYqEk\""},{"key":"Date","value":"Fri, 07 May 2021 04:51:22 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": {\n        \"n\": 0,\n        \"ok\": 1,\n        \"deletedCount\": 0\n    }\n}"},{"id":"77fd6f73-f6b6-4417-a6bd-13fdf9c6976b","name":"Bad request - [400]","originalRequest":{"method":"DELETE","header":[],"url":"http://localhost:3000/users/phone/87896876"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"99"},{"key":"ETag","value":"W/\"63-12cU7wiiHYk3FITe8T8IXaYTvUg\""},{"key":"Date","value":"Fri, 07 May 2021 04:51:52 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"value\": \"87896876\",\n            \"msg\": \"Invalid phone number\",\n            \"param\": \"number\",\n            \"location\": \"params\"\n        }\n    ]\n}"}],"_postman_id":"c69f7440-c829-4299-9077-5c4418a13330"},{"name":"Get all users","id":"b8a47230-0f04-4ce9-b5c7-706e1986fc75","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/users/","description":"<p>Get all users that exist in collection.\nFormat - <code>http://localhost:3000/users/</code></p>\n","urlObject":{"protocol":"http","port":"3000","path":["users",""],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"d87de221-2e19-48ba-a5e2-8d0843b17898","name":"Success[200]","originalRequest":{"method":"GET","header":[],"url":"http://localhost:3000/users/"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"459"},{"key":"ETag","value":"W/\"1cb-hrMJh8HBh5+VTz7Xu0qTQGnUPFU\""},{"key":"Date","value":"Fri, 07 May 2021 04:52:59 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"users\": [\n        {\n            \"_id\": \"f289192b45dd4ecb9fc0fe9263ec287a\",\n            \"firstName\": \"eren\",\n            \"lastName\": \"yeager\",\n            \"phoneNumber\": \"9807486082\",\n            \"userType\": \"CONSUMER\",\n            \"createdAt\": \"2021-05-06T14:32:26.553Z\",\n            \"updatedAt\": \"2021-05-06T14:32:26.553Z\",\n            \"__v\": 0\n        },\n        {\n            \"_id\": \"f25b952207cd4802bcf1292712f2bba3\",\n            \"firstName\": \"dina\",\n            \"lastName\": \"fritz\",\n            \"phoneNumber\": \"7898088970\",\n            \"userType\": \"CONSUMER\",\n            \"createdAt\": \"2021-05-06T14:35:05.433Z\",\n            \"updatedAt\": \"2021-05-06T14:35:05.433Z\",\n            \"__v\": 0\n        }\n    ]\n}"}],"_postman_id":"b8a47230-0f04-4ce9-b5c7-706e1986fc75"}],"id":"33814cda-17a8-4153-87c3-d2098927dac3","description":"<hr />\n<h3 id=\"methods--\">Methods -</h3>\n<ul>\n<li>[POST] Create new user</li>\n<li>[GET] Get all users</li>\n<li>[GET] Get user by id</li>\n<li>[GET] Get user by phone number</li>\n<li>[DELETE] Delete user by id</li>\n<li>[DELETE] Delete user by phone number</li>\n</ul>\n<hr />\n<h3 id=\"user-schema--\">User Schema -</h3>\n<ul>\n<li>Mongoose -</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>const userSchema = new mongoose.Schema(\n    {\n        _id : {\n            type : String, \n            default : () =&gt; uuid.v4().replace(/\\-/g, \"\"),\n        }, \n        firstName : String,\n        lastName : String, \n        phoneNumber :String,\n        userType : String,\n    },\n    {\n        timestamps : true,\n        collection : 'users',\n    }\n);\n</code></pre><ul>\n<li>JSON -</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"_id\": uuid.v4,\n    \"firstName\": \"bertholt\",\n    \"lastName\": \"bertoloto\",\n    \"phoneNumber\": \"7893233970\",\n    \"userType\": \"CONSUMER\",\n    \"createdAt\": \"2021-05-06T14:35:33.418Z\",\n    \"updatedAt\": \"2021-05-06T14:35:33.418Z\",\n    \"__v\": 0\n}\n</code></pre><hr />\n<h2 id=\"validations--\">Validations -</h2>\n<ul>\n<li>Phone number should be 10 digit numeric</li>\n<li>usertype should be either consumer or developer</li>\n<li>Edge cases not implemented till now - <ul>\n<li>uuid validation</li>\n<li>phone number leading 0s</li>\n</ul>\n</li>\n</ul>\n","_postman_id":"33814cda-17a8-4153-87c3-d2098927dac3"},{"name":"authAPI","item":[{"name":"SignUp user","id":"176bdf8a-dce1-4f87-adfd-fe81974705b1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"firstName\" : \"Mitsui\",\n    \"lastName\" : \"Ryu\",\n    \"phoneNumber\" : \"1233338443\",\n    \"password\" : \"nTJ?C69Q\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/signup","description":"<p>This request signs up user after valdiationg the details. The password should be - </p>\n<ul>\n<li>Min 8 charaters</li>\n<li>Atleast one lowercase english alphabet</li>\n<li>Atleast one uppercase english alphabet</li>\n<li>Atleast one number</li>\n<li>Atleast one special symbol</li>\n</ul>\n<p><strong>Note</strong> - This dosen't return authToken, user need to login after this</p>\n","urlObject":{"protocol":"http","port":"3000","path":["signup"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"f93c04b3-f49b-49d7-bdf1-0b9000a2d86a","name":"Success [ 200]","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"firstName\" : \"Dan\",\n    \"lastName\" : \"Kyuso\",\n    \"phoneNumber\" : \"1542228452\",\n    \"password\" : \"nTJ?C69S\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/signup"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"93"},{"key":"ETag","value":"W/\"5d-Far/Irt/V68t1bb8zNhRqtDRr90\""},{"key":"Date","value":"Fri, 07 May 2021 11:23:55 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"user\": {\n        \"_id\": \"383f5bc4621042af9c5c8abc30c21292\",\n        \"phoneNumber\": \"1542228452\"\n    }\n}"},{"id":"ed95c5bf-623d-490e-b579-722d37648e19","name":"Bad request [400]","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"firstName\" : \"Dan\",\n    \"lastName\" : \"Kyuso\",\n    \"phoneNumber\" : \"154228452\",\n    \"password\" : \"nTJ?C6S\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/signup"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"182"},{"key":"ETag","value":"W/\"b6-wPvk9/j7wOWjCpuTZ79XD3EITaU\""},{"key":"Date","value":"Fri, 07 May 2021 11:29:00 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"value\": \"154228452\",\n            \"msg\": \"Invalid phone number\",\n            \"param\": \"phoneNumber\",\n            \"location\": \"body\"\n        },\n        {\n            \"value\": \"nTJ?C6S\",\n            \"msg\": \"Invalid value\",\n            \"param\": \"password\",\n            \"location\": \"body\"\n        }\n    ]\n}"},{"id":"49a0cabf-6dae-4f58-a6e0-2ff92a7be87e","name":"Phone number already in use [400]","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"firstName\" : \"Dan\",\n    \"lastName\" : \"Kyuso\",\n    \"phoneNumber\" : \"1542228452\",\n    \"password\" : \"nTJ?C69S\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/signup"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"75"},{"key":"ETag","value":"W/\"4b-cWz3bCTlHbstBu13WEPTjI09clE\""},{"key":"Date","value":"Fri, 07 May 2021 11:32:50 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"message\": \"This phone number is already in use\"\n    }\n}"},{"id":"b94408cc-604e-4c35-8cba-9bcbf3862a42","name":"user-mitsui","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"firstName\" : \"Mitsui\",\n    \"lastName\" : \"Ryu\",\n    \"phoneNumber\" : \"1233338443\",\n    \"password\" : \"nTJ?C69Q\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/signup"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"93"},{"key":"ETag","value":"W/\"5d-ueql+2STLQfuQkqjfq72P8yjMkk\""},{"key":"Date","value":"Sun, 30 May 2021 19:33:03 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"user\": {\n        \"_id\": \"aab964d8d5e443fba6c9f96571bef6ee\",\n        \"phoneNumber\": \"1233338443\"\n    }\n}"}],"_postman_id":"176bdf8a-dce1-4f87-adfd-fe81974705b1"},{"name":"Login user","id":"817d4059-06e4-4820-9ce7-b8ba084d8c3b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"phoneNumber\" : \"1233338443\",\n    \"password\" : \"nTJ?C69Q\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/login","description":"<p>Logins user and returns the authToken.</p>\n<ul>\n<li>Format - <code>http://localhost:3000/login</code></li>\n</ul>\n","urlObject":{"protocol":"http","port":"3000","path":["login"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"b6c20ad8-ca5e-4cc6-ba98-1a4c14d2ed50","name":"Success - [200]","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"phoneNumber\" : \"1543338443\",\n    \"password\" : \"nTJ?C69Q\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"196"},{"key":"ETag","value":"W/\"c4-mkjZNtYvpqpoa3lEFL901F3MMPE\""},{"key":"Date","value":"Fri, 07 May 2021 12:22:42 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"authToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNzJmMjNhYzk2ODA4NGM0YTk2N2MzNzZmN2YyNTA4YmMiLCJpYXQiOjE2MjAzOTAxNjJ9.2WJm0NCQmJhCsEsgjXcFsmOsaTHH65g-TLhbvKSRkrM\"\n}"},{"id":"539ea982-5ce7-4edc-b79b-eb228e82820f","name":"User doesn't exists [400]","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"phoneNumber\" : \"1543338442\",\n    \"password\" : \"nTJ?C69Q\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/login"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"77"},{"key":"ETag","value":"W/\"4d-pM5uhSCnRpux8HDOURxXX+r691A\""},{"key":"Date","value":"Fri, 07 May 2021 12:29:19 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"message\": \"No user with this phone number exists\"\n    }\n}"},{"id":"0b79a816-234c-4180-913d-63105dc34f6a","name":"Password incorrect [400]","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"phoneNumber\" : \"1543338443\",\n    \"password\" : \"nTJ?C69QQQ\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/login"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"61"},{"key":"ETag","value":"W/\"3d-dy6djK6tqmbis+Tgzpyxew4GWM8\""},{"key":"Date","value":"Fri, 07 May 2021 12:30:17 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"message\": \"Password is incorrect\"\n    }\n}"},{"id":"d4a6f642-c72c-44dc-8018-9432abd9d80d","name":"Bad Request [400]","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"phoneNumber\" : \"15433384\",\n    \"password\" : \"nTJ?C6\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/login"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"196"},{"key":"ETag","value":"W/\"c4-GjXSJHg6KAUe/9zoW6laH0my1cE\""},{"key":"Date","value":"Fri, 07 May 2021 12:31:53 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"errors\": [\n        {\n            \"value\": \"15433384\",\n            \"msg\": \"Invalid phone number\",\n            \"param\": \"phoneNumber\",\n            \"location\": \"body\"\n        },\n        {\n            \"value\": \"nTJ?C6\",\n            \"msg\": \"Invalid value\",\n            \"param\": \"password\",\n            \"location\": \"body\"\n        }\n    ]\n}"}],"_postman_id":"817d4059-06e4-4820-9ce7-b8ba084d8c3b"}],"id":"812ee62b-590f-42fc-9126-a8391d18ccc3","description":"<hr />\n<h3 id=\"methods--\">Methods -</h3>\n<ul>\n<li><p>[POST] Login User and get authorization JWT(Json Web Token)</p>\n</li>\n<li><p>[POST] Signup a new user, doesn't provides authorization token</p>\n</li>\n<li><p><em>By default every new user is a consumer</em></p>\n</li>\n</ul>\n<hr />\n<h3 id=\"user-schema--\">User Schema -</h3>\n<ul>\n<li>Mongoose -</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>const authSchema = new mongoose.Schema(\n    {\n        _id : {\n            type : String, \n            default : () =&gt; v4().replace(/\\-/g, \"\"),\n        },\n        phoneNumber : String,\n        hash : String,\n    },\n    {\n        timestamps : true,\n        collection : 'auths'\n    }\n);\n</code></pre><ul>\n<li>JSON</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n    \"_id\" : \"bcbffd5d44204242be1948ba1b562c72\",\n    \"phoneNumber\" : \"1543338443\",\n    \"hash\" : \"$2a$10$TyPMHmvNXHT1BjBjEtzV2OH6dVKiJqEjEs7ww3lnqnMi.uCYTKK1.\",\n    \"createdAt\" : ISODate(\"2021-05-07T12:26:15.088Z\"),\n    \"updatedAt\" : ISODate(\"2021-05-07T12:26:15.088Z\"),\n    \"__v\" : 0\n}\n</code></pre><hr />\n<h2 id=\"validations--\">Validations -</h2>\n<ul>\n<li>Phone number should be 10 digit numeric</li>\n<li>Edge cases not implemented till now - <ul>\n<li>phone number leading 0s</li>\n</ul>\n</li>\n</ul>\n","_postman_id":"812ee62b-590f-42fc-9126-a8391d18ccc3"},{"name":"chatRoomAPI","item":[{"name":"Initiate","id":"92a88a29-a2f3-40d1-89c8-8410bcbcb02f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiYWFiOTY0ZDhkNWU0NDNmYmE2YzlmOTY1NzFiZWY2ZWUiLCJpYXQiOjE2MjI5MjAyNDJ9.ZOeS3-KjuUmA8jAabv7netGM19cOdxZDtP4oYXP_vmE","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"userIds\" : [\"1e6f2dec541e43fc932977e3885acdd2\", \"bcbffd5d44204242be1948ba1b562c72\"]\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/chatRoom/initiate","description":"<p>This post request initiates a chat room with given userIds in body and current logged in user(extrated through auth token)</p>\n<ul>\n<li>req url : <code>http://localhost:3000/chatRoom/initiate</code></li>\n</ul>\n","urlObject":{"protocol":"http","port":"3000","path":["chatRoom","initiate"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"d744d8be-378c-4769-96de-b31ff09547cb","name":"Room already exists","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNWQ3YWZlNWYyMGI1NDlmZjk4MDg4ZTc2YTllMjdlMjQiLCJpYXQiOjE2MjE0MTYzMTd9.AC82cAq3YWq910gUFmV4DAahW7YbxHcshoFc6cMg7Ow","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"userIds\" : [\"bcbffd5d44204242be1948ba1b562c72\", \"1e6f2dec541e43fc932977e3885acdd2\"]\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/chatRoom/initiate"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"131"},{"key":"ETag","value":"W/\"83-DiL8HqU9SYpLXKEz7Lkx4kFH304\""},{"key":"Date","value":"Thu, 20 May 2021 17:26:50 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"chatRoom\": {\n        \"isNew\": false,\n        \"message\": \"retrieving an old chat room\",\n        \"chatRoomId\": \"fe4fdf32242142f3aa295e328153feee\"\n    }\n}"}],"_postman_id":"92a88a29-a2f3-40d1-89c8-8410bcbcb02f"},{"name":"Post message","id":"45fe6426-38c2-453a-9b7c-def98af427e9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiYWFiOTY0ZDhkNWU0NDNmYmE2YzlmOTY1NzFiZWY2ZWUiLCJpYXQiOjE2MjI0MDMzODV9.kfleP_zPjRPxLElM0f_QX-BnIWFvqDXkgK61l7R2HT8","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"messageText\" : \"Hajime Mashte\",\n    \"chatRoomId\" : \"e8b2f19a898846f7936992ffeb51bb64\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/chatRoom/message","description":"<p>This request posts a message in corresponding chatroom and returns a modified response rather than just the posted document by aggregating info of userIds by looking up from other collections and then grouping it</p>\n<ul>\n<li>Format of request - <code>http://localhost:3000/chatRoom/message</code></li>\n</ul>\n","urlObject":{"protocol":"http","port":"3000","path":["chatRoom","message"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"1fb8c1d0-7234-4876-ac6a-eb7e5f8808fd","name":"success - aggregated repons","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNWQ3YWZlNWYyMGI1NDlmZjk4MDg4ZTc2YTllMjdlMjQiLCJpYXQiOjE2MjE1MzE3NTN9.JaNb0QhoqvtLdUL7r4MIimh5P3ZKSVmASAkhaoJZWqA","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"messageText\" : \"Ara Ara, Konichiwa..\",\n    \"chatRoomId\" : \"fe4fdf32242142f3aa295e328153feee\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/chatRoom/message"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1269"},{"key":"ETag","value":"W/\"4f5-kt9agFpok6tl+dqdG8ezLED2mIk\""},{"key":"Date","value":"Fri, 21 May 2021 02:41:48 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"post\": [\n        {\n            \"_id\": \"529bc510a48944c88cff489b2f8342f3\",\n            \"chatRoomId\": \"fe4fdf32242142f3aa295e328153feee\",\n            \"message\": {\n                \"messageText\": \"Ara Ara, Konichiwa..\"\n            },\n            \"type\": \"text\",\n            \"postedByUser\": {\n                \"_id\": \"5d7afe5f20b549ff98088e76a9e27e24\",\n                \"firstName\": \"dan\",\n                \"lastName\": \"kyuso\",\n                \"phoneNumber\": \"1542228452\",\n                \"userType\": \"CONSUMER\",\n                \"createdAt\": \"2021-05-08T15:54:04.970Z\",\n                \"updatedAt\": \"2021-05-08T15:54:04.970Z\",\n                \"__v\": 0\n            },\n            \"chatRoomUsers\": [\n                {\n                    \"_id\": \"1e6f2dec541e43fc932977e3885acdd2\",\n                    \"firstName\": \"itadori\",\n                    \"lastName\": \"yuuhi\",\n                    \"phoneNumber\": \"4333685112\",\n                    \"userType\": \"CONSUMER\",\n                    \"createdAt\": \"2021-05-08T15:56:09.067Z\",\n                    \"updatedAt\": \"2021-05-08T15:56:09.067Z\",\n                    \"__v\": 0\n                },\n                {\n                    \"_id\": \"bcbffd5d44204242be1948ba1b562c72\",\n                    \"firstName\": \"natsu\",\n                    \"lastName\": \"dragoneel\",\n                    \"phoneNumber\": \"1543338443\",\n                    \"userType\": \"CONSUMER\",\n                    \"createdAt\": \"2021-05-07T12:26:15.080Z\",\n                    \"updatedAt\": \"2021-05-07T12:26:15.080Z\",\n                    \"__v\": 0\n                },\n                {\n                    \"_id\": \"5d7afe5f20b549ff98088e76a9e27e24\",\n                    \"firstName\": \"dan\",\n                    \"lastName\": \"kyuso\",\n                    \"phoneNumber\": \"1542228452\",\n                    \"userType\": \"CONSUMER\",\n                    \"createdAt\": \"2021-05-08T15:54:04.970Z\",\n                    \"updatedAt\": \"2021-05-08T15:54:04.970Z\",\n                    \"__v\": 0\n                }\n            ],\n            \"readByRecipients\": [\n                {\n                    \"readAt\": \"2021-05-21T02:33:50.926Z\",\n                    \"readByUserId\": \"5d7afe5f20b549ff98088e76a9e27e24\"\n                }\n            ],\n            \"createdAt\": \"2021-05-21T02:41:48.146Z\",\n            \"updatedAt\": \"2021-05-21T02:41:48.146Z\"\n        }\n    ]\n}"},{"id":"82858765-1613-4512-b720-6f6540c9711a","name":"success-example-1","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNWQ3YWZlNWYyMGI1NDlmZjk4MDg4ZTc2YTllMjdlMjQiLCJpYXQiOjE2MjE1MzE3NTN9.JaNb0QhoqvtLdUL7r4MIimh5P3ZKSVmASAkhaoJZWqA","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"messageText\" : \"Ara Ara, Konichiwa..\",\n    \"chatRoomId\" : \"641c2e3065a549e381d4b133a5d9e2b7\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/chatRoom/message"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1045"},{"key":"ETag","value":"W/\"415-g4FTx7hoRF53mDlFa0ow1j0Jou8\""},{"key":"Date","value":"Sun, 30 May 2021 19:35:06 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"post\": [\n        {\n            \"_id\": \"e93d0e1c0cda4e9dbce17eca2755ef3a\",\n            \"chatRoomId\": \"641c2e3065a549e381d4b133a5d9e2b7\",\n            \"message\": {\n                \"messageText\": \"Ara Ara, Konichiwa..\"\n            },\n            \"type\": \"text\",\n            \"postedByUser\": {\n                \"_id\": \"5d7afe5f20b549ff98088e76a9e27e24\",\n                \"firstName\": \"dan\",\n                \"lastName\": \"kyuso\",\n                \"phoneNumber\": \"1542228452\",\n                \"userType\": \"CONSUMER\",\n                \"createdAt\": \"2021-05-08T15:54:04.970Z\",\n                \"updatedAt\": \"2021-05-08T15:54:04.970Z\",\n                \"__v\": 0\n            },\n            \"chatRoomUsers\": [\n                {\n                    \"_id\": \"5d7afe5f20b549ff98088e76a9e27e24\",\n                    \"firstName\": \"dan\",\n                    \"lastName\": \"kyuso\",\n                    \"phoneNumber\": \"1542228452\",\n                    \"userType\": \"CONSUMER\",\n                    \"createdAt\": \"2021-05-08T15:54:04.970Z\",\n                    \"updatedAt\": \"2021-05-08T15:54:04.970Z\",\n                    \"__v\": 0\n                },\n                {\n                    \"_id\": \"aab964d8d5e443fba6c9f96571bef6ee\",\n                    \"firstName\": \"mitsui\",\n                    \"lastName\": \"ryu\",\n                    \"phoneNumber\": \"1233338443\",\n                    \"userType\": \"CONSUMER\",\n                    \"createdAt\": \"2021-05-30T19:33:03.319Z\",\n                    \"updatedAt\": \"2021-05-30T19:33:03.319Z\",\n                    \"__v\": 0\n                }\n            ],\n            \"readByRecipients\": [\n                {\n                    \"readAt\": \"2021-05-30T19:29:01.050Z\",\n                    \"readByUserId\": \"5d7afe5f20b549ff98088e76a9e27e24\"\n                }\n            ],\n            \"createdAt\": \"2021-05-30T19:35:06.638Z\",\n            \"updatedAt\": \"2021-05-30T19:35:06.638Z\"\n        }\n    ]\n}"}],"_postman_id":"45fe6426-38c2-453a-9b7c-def98af427e9"},{"name":"get recent conversations by chatRoomId","id":"ccbc7044-fd6b-48fa-aa3f-2bdcfddbf80e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiYWFiOTY0ZDhkNWU0NDNmYmE2YzlmOTY1NzFiZWY2ZWUiLCJpYXQiOjE2MjI0MDMzODV9.kfleP_zPjRPxLElM0f_QX-BnIWFvqDXkgK61l7R2HT8","type":"text"}],"url":"http://localhost:3000/chatRoom/e8b2f19a898846f7936992ffeb51bb64?page=0&limit=3","description":"<p>Returns the recent conversations in a chatroom and users in that chat room.\nTakes in optional query parameters for pagination, default being page = 0, limit = 10.</p>\n<p>Format - <code>http://localhost:3000/chatRoom/:roomId?page=200&amp;limit=3</code></p>\n","urlObject":{"protocol":"http","port":"3000","path":["chatRoom","e8b2f19a898846f7936992ffeb51bb64"],"host":["localhost"],"query":[{"key":"page","value":"0"},{"key":"limit","value":"3"}],"variable":[]}},"response":[],"_postman_id":"ccbc7044-fd6b-48fa-aa3f-2bdcfddbf80e"},{"name":"mark messages read by roomId","id":"3bf7ea79-a480-4aac-b6c4-524a7e60d0fd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiYWFiOTY0ZDhkNWU0NDNmYmE2YzlmOTY1NzFiZWY2ZWUiLCJpYXQiOjE2MjI0MDMzODV9.kfleP_zPjRPxLElM0f_QX-BnIWFvqDXkgK61l7R2HT8","type":"text"}],"url":"http://localhost:3000/chatRoom/641c2e3065a549e381d4b133a5d9e2b7/mark-read","description":"<p>This marks the messages in a particular room  id of which user is a part of</p>\n","urlObject":{"protocol":"http","port":"3000","path":["chatRoom","641c2e3065a549e381d4b133a5d9e2b7","mark-read"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"3bf7ea79-a480-4aac-b6c4-524a7e60d0fd"},{"name":"Get all chat rooms","id":"8c6e7b9b-3d67-45b0-b79d-6d175610bea8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiYWFiOTY0ZDhkNWU0NDNmYmE2YzlmOTY1NzFiZWY2ZWUiLCJpYXQiOjE2MjI5MjAyNDJ9.ZOeS3-KjuUmA8jAabv7netGM19cOdxZDtP4oYXP_vmE","type":"text"}],"url":"http://localhost:3000/chatRoom/","description":"<p>This get request return all the chatRooms present in the database</p>\n<ul>\n<li>Format : <code>http://localhost:3000/chatRoom/</code></li>\n</ul>\n","urlObject":{"protocol":"http","port":"3000","path":["chatRoom",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"8c6e7b9b-3d67-45b0-b79d-6d175610bea8"}],"id":"80039779-878d-462c-8d1c-e18df5fb5743","_postman_id":"80039779-878d-462c-8d1c-e18df5fb5743","description":""},{"name":"deleteAPI","item":[{"name":"Delete chatRoom by ID and all messages","id":"63e1283b-a49c-4822-b3d3-d133d89330fe","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiYWFiOTY0ZDhkNWU0NDNmYmE2YzlmOTY1NzFiZWY2ZWUiLCJpYXQiOjE2MjI5MjAyNDJ9.ZOeS3-KjuUmA8jAabv7netGM19cOdxZDtP4oYXP_vmE","type":"text"}],"url":"http://localhost:3000/delete/room/641c2e3065a549e381d4b133a5d9e2b7","description":"<p>Deletes the chat room with the given chat room id and removes all the chat messages with the roomId as given room id</p>\n<p>url = <code>http://localhost:3000/delete/room/:roomId</code></p>\n","urlObject":{"protocol":"http","port":"3000","path":["delete","room","641c2e3065a549e381d4b133a5d9e2b7"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"63e1283b-a49c-4822-b3d3-d133d89330fe"},{"name":"http://localhost:3000/delete/message/:messageId","id":"a207c47b-7bbe-4a58-ad0e-4cf8f19434c8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiYWFiOTY0ZDhkNWU0NDNmYmE2YzlmOTY1NzFiZWY2ZWUiLCJpYXQiOjE2MjI5MjAyNDJ9.ZOeS3-KjuUmA8jAabv7netGM19cOdxZDtP4oYXP_vmE","type":"text"}],"url":"http://localhost:3000/delete/message/:messageId","description":"<p>This deleted the message by its id</p>\n<p>format = <code>http://localhost:3000/delete/message/:messageId</code></p>\n","urlObject":{"protocol":"http","port":"3000","path":["delete","message",":messageId"],"host":["localhost"],"query":[],"variable":[{"id":"2b3a2bf5-9dd3-4965-bbf0-666ff15931ab","type":"any","value":"3db3aa84d64b4111bee86c27745d201f","key":"messageId"}]}},"response":[],"_postman_id":"a207c47b-7bbe-4a58-ad0e-4cf8f19434c8"}],"id":"576d6180-f33f-4f7c-8027-d59cb246a7c7","description":"<p>This folder contains requests related to deleting chatrooms/chatmessages</p>\n","_postman_id":"576d6180-f33f-4f7c-8027-d59cb246a7c7"}],"event":[{"listen":"prerequest","script":{"id":"b6463bae-a6dc-4fff-8c53-167fab5f75c8","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"b876b31e-33d6-4791-91e0-b15b5d684801","type":"text/javascript","exec":[""]}}],"variable":[{"key":"number","value":"87896876"}]}