{"info":{"_postman_id":"e5daf022-807d-48c4-9640-985aae8b0e69","name":"SMS manager","description":"<html><head></head><body><h1 id=\"introduction\">Introduction</h1>\n<p>What does your API do?\nA simple SMS management API that manages the sending and receiving of messages.</p>\n<h1 id=\"overview\">Overview</h1>\n<p>Make sure to have the API running locally and mongodb installed and running on your machine.</p>\n<h1 id=\"authentication\">Authentication</h1>\n<p>What is the preferred way of using the API?</p>\n<p>Bearer token</p>\n<h1 id=\"error-codes\">Error Codes</h1>\n<p>What errors and status codes can a user expect?\n200 - For all successful responses.</p>\n<p>201 - For all successful addition/creation made to the API.</p>\n<p>400 - For all bad requests send to the API</p>\n<p>401 - For all unauthorized requests to the API</p>\n<p>404 - For all requests where the requested reaource is not found.</p>\n<p>500 - For all internal server errors.</p>\n<h1 id=\"rate-limit\">Rate limit</h1>\n<p>Is there a limit to the number of requests an user can send?\nNo.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Introduction","slug":"introduction"},{"content":"Overview","slug":"overview"},{"content":"Authentication","slug":"authentication"},{"content":"Error Codes","slug":"error-codes"},{"content":"Rate limit","slug":"rate-limit"}],"owner":"1489197","collectionId":"e5daf022-807d-48c4-9640-985aae8b0e69","publishedId":"SVYouKbV","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-08-01T18:16:46.000Z"},"item":[{"name":"Create user","id":"7bebc079-c396-4b99-a535-b7c794e05423","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"email\": \"user@gmail.com\",\n\t\"password\": \"password\"\n}"},"url":"http://localhost:5050/api/v1/users/","urlObject":{"protocol":"http","port":"5050","path":["api","v1","users",""],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"f2493820-654d-42c3-ad49-96d3cd8ff76c","name":"Create user","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"email\": \"test_user@gmail.com\",\n\t\"password\": \"@rticul@tE\"\n}"},"url":"http://localhost:5050/api/v1/users/"},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"status\": 201,\n    \"result\": {\n        \"_id\": \"5d4327c487581b481ca29c74\",\n        \"email\": \"test_user@gmail.com\",\n        \"password\": \"password\",\n        \"__v\": 0\n    }\n}"}],"_postman_id":"7bebc079-c396-4b99-a535-b7c794e05423"},{"name":"Login user","id":"a60fb710-1c69-4925-90a0-3eb3e6126a91","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"email\": \"brian@gmail.com\",\n\t\"password\": \"password\"\n}"},"url":"http://localhost:5050/api/v1/login/","urlObject":{"protocol":"http","port":"5050","path":["api","v1","login",""],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"33af114d-de05-4444-b62c-23d3beb185f1","name":"Login user","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"email\": \"test_user@gmail.com\",\n\t\"password\": \"@rticul@tE\"\n}"},"url":"http://localhost:5050/api/v1/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":"376"},{"key":"ETag","value":"W/\"178-Anf1/a2LkqQD4NxMvnQf8b5igoI\""},{"key":"Date","value":"Thu, 01 Aug 2019 12:54:48 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjoiYnJpYW5AZ21haWwuY29tIiwiaWF0IjoxNTY0NjY0MDg4LCJleHAiOjE1NjQ3NTA0ODgsImlzcyI6Imh0dHBzOi8vYW5kZWxhLmNvbS8ifQ.8s84yO8biO17B3ihJwoQrkXvLN9QIhK_s-yNKY6m8bs\",\n    \"status\": 200,\n    \"result\": {\n        \"_id\": \"5d42bfe7de2177d820cee16d\",\n        \"email\": \"test_user@gmail.com\",\n        \"password\": \"$2b$10$GlaaZTSHOfffdWhWLIMxy.ieyfRE/ETQiVSZmGqtQD.3ce..fXPzu\",\n        \"__v\": 0\n    }\n}"}],"_postman_id":"a60fb710-1c69-4925-90a0-3eb3e6126a91"},{"name":"Get all contacts","id":"ff9de3a3-70ac-4997-9d96-b42a80ae9860","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5050/api/v1/contacts/","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"e5daf022-807d-48c4-9640-985aae8b0e69","id":"e5daf022-807d-48c4-9640-985aae8b0e69","name":"SMS manager","type":"collection"}},"urlObject":{"protocol":"http","port":"5050","path":["api","v1","contacts",""],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"dad1e6c5-b49f-444f-8f00-4f875b2b1367","name":"Get all contacts","originalRequest":{"method":"GET","header":[],"url":"http://localhost:5050/api/v1/contacts/"},"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-1NODu2PamsBcH7gTylh3WzM/hCU\""},{"key":"Date","value":"Fri, 02 Aug 2019 07:56:26 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": 200,\n    \"data\": [\n        {\n            \"_id\": \"5d42d8b3e7f122ef07ff89a5\",\n            \"firstName\": \"nancy\",\n            \"lastName\": \"mugai\",\n            \"phoneNumber\": \"0708787979\",\n            \"__v\": 0\n        },\n        {\n            \"_id\": \"5d432c3a87581b481ca29c75\",\n            \"firstName\": \"denis\",\n            \"lastName\": \"oti\",\n            \"phoneNumber\": \"0708223355\",\n            \"__v\": 0\n        }\n    ]\n}"}],"_postman_id":"ff9de3a3-70ac-4997-9d96-b42a80ae9860"},{"name":"Create contact","id":"64bbcc55-c4f5-4afb-9ddb-577f145d1fd6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"firstName\": \"nancy\",\n\t\"lastName\": \"mugai\",\n\t\"phoneNumber\": \"0708787979\"\n}"},"url":"http://localhost:5050/api/v1/contacts/","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"e5daf022-807d-48c4-9640-985aae8b0e69","id":"e5daf022-807d-48c4-9640-985aae8b0e69","name":"SMS manager","type":"collection"}},"urlObject":{"protocol":"http","port":"5050","path":["api","v1","contacts",""],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"d85eae75-c4f1-45c5-b028-218922bd0058","name":"Create contact","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"firstName\": \"denis\",\n\t\"lastName\": \"oti\",\n\t\"phoneNumber\": \"0708223355\"\n}"},"url":"http://localhost:5050/api/v1/contacts/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"130"},{"key":"ETag","value":"W/\"82-7WN0xtjSvgr6irHM55ywCY8OKcQ\""},{"key":"Date","value":"Thu, 01 Aug 2019 18:15:23 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": 201,\n    \"result\": {\n        \"_id\": \"5d432c3a87581b481ca29c75\",\n        \"firstName\": \"denis\",\n        \"lastName\": \"oti\",\n        \"phoneNumber\": \"0708223355\",\n        \"__v\": 0\n    }\n}"}],"_postman_id":"64bbcc55-c4f5-4afb-9ddb-577f145d1fd6"},{"name":"Delete contact","id":"426e831b-a766-493e-b61c-3b7c128b2b67","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:5050/api/v1/contacts/5d414dc4872b8083d456a9cc","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"e5daf022-807d-48c4-9640-985aae8b0e69","id":"e5daf022-807d-48c4-9640-985aae8b0e69","name":"SMS manager","type":"collection"}},"urlObject":{"protocol":"http","port":"5050","path":["api","v1","contacts","5d414dc4872b8083d456a9cc"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"426e831b-a766-493e-b61c-3b7c128b2b67"},{"name":"Get all messages","id":"0546f36c-cc92-4a65-a7bb-b73387e1ffe6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5050/api/v1/messages/","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"e5daf022-807d-48c4-9640-985aae8b0e69","id":"e5daf022-807d-48c4-9640-985aae8b0e69","name":"SMS manager","type":"collection"}},"urlObject":{"protocol":"http","port":"5050","path":["api","v1","messages",""],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"6b8ea690-310e-45d0-8ace-8a74891a3275","name":"Get all messages","originalRequest":{"method":"GET","header":[],"url":"http://localhost:5050/api/v1/messages/"},"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":"941"},{"key":"ETag","value":"W/\"3ad-mHr/VEGd2NRJNKvhF2FBJMzTOPk\""},{"key":"Date","value":"Fri, 02 Aug 2019 08:14:16 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": 200,\n    \"data\": [\n        {\n            \"_id\": \"5d42d8d1e7f122ef07ff89a6\",\n            \"message\": \"wacha wewe\",\n            \"sender\": {\n                \"_id\": \"5d42d8b3e7f122ef07ff89a5\",\n                \"firstName\": \"nancy\",\n                \"lastName\": \"mugai\",\n                \"phoneNumber\": \"0708787979\",\n                \"__v\": 0\n            },\n            \"recipient\": null,\n            \"__v\": 0\n        },\n        {\n            \"_id\": \"5d42dba018a3cef3c062cd0c\",\n            \"message\": \"wacha wewe\",\n            \"sender\": {\n                \"_id\": \"5d42d8b3e7f122ef07ff89a5\",\n                \"firstName\": \"nancy\",\n                \"lastName\": \"mugai\",\n                \"phoneNumber\": \"0708787979\",\n                \"__v\": 0\n            },\n            \"recipient\": null,\n            \"__v\": 0\n        },\n        {\n            \"_id\": \"5d42e2646f8d02f9eab656d0\",\n            \"message\": \"wacha wewe\",\n            \"sender\": {\n                \"_id\": \"5d42d8b3e7f122ef07ff89a5\",\n                \"firstName\": \"nancy\",\n                \"lastName\": \"mugai\",\n                \"phoneNumber\": \"0708787979\",\n                \"__v\": 0\n            },\n            \"recipient\": null,\n            \"__v\": 0\n        },\n        {\n            \"_id\": \"5d432c4187581b481ca29c76\",\n            \"message\": \"Hey. How was your day?\",\n            \"sender\": {\n                \"_id\": \"5d42d8b3e7f122ef07ff89a5\",\n                \"firstName\": \"nancy\",\n                \"lastName\": \"mugai\",\n                \"phoneNumber\": \"0708787979\",\n                \"__v\": 0\n            },\n            \"recipient\": {\n                \"_id\": \"5d432c3a87581b481ca29c75\",\n                \"firstName\": \"denis\",\n                \"lastName\": \"oti\",\n                \"phoneNumber\": \"0708223355\",\n                \"__v\": 0\n            },\n            \"__v\": 0\n        }\n    ]\n}"}],"_postman_id":"0546f36c-cc92-4a65-a7bb-b73387e1ffe6"},{"name":"Create message","id":"7787a858-e955-40c2-a3e3-914bb5b70016","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"sender\": \"0708223344\",\n\t\"recipient\": \"0708223355\",\n\t\"message\": \"wacha wewe\"\n}"},"url":"http://localhost:5050/api/v1/messages/","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"e5daf022-807d-48c4-9640-985aae8b0e69","id":"e5daf022-807d-48c4-9640-985aae8b0e69","name":"SMS manager","type":"collection"}},"urlObject":{"protocol":"http","port":"5050","path":["api","v1","messages",""],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"bf2c6819-363c-406c-894c-c01926e5af6e","name":"Create message","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"sender\": \"0708787979\",\n\t\"recipient\": \"0708223355\",\n\t\"message\": \"Hey. How was your day?\"\n}"},"url":"http://localhost:5050/api/v1/messages/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"174"},{"key":"ETag","value":"W/\"ae-MvGl0ezmi7mmJb+M7RlVjhULXiU\""},{"key":"Date","value":"Fri, 02 Aug 2019 08:15:06 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": 201,\n    \"data\": {\n        \"_id\": \"5d43f10a87581b481ca29c77\",\n        \"message\": \"Hey. How was your day?\",\n        \"sender\": \"5d42d8b3e7f122ef07ff89a5\",\n        \"recipient\": \"5d432c3a87581b481ca29c75\",\n        \"__v\": 0\n    }\n}"}],"_postman_id":"7787a858-e955-40c2-a3e3-914bb5b70016"},{"name":"Delete Message","id":"812af494-5cc3-4208-98f5-da202982c997","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:5050/api/v1/messages/5d42c9261b1faddfad012990","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"e5daf022-807d-48c4-9640-985aae8b0e69","id":"e5daf022-807d-48c4-9640-985aae8b0e69","name":"SMS manager","type":"collection"}},"urlObject":{"protocol":"http","port":"5050","path":["api","v1","messages","5d42c9261b1faddfad012990"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"cbb51567-d910-4e96-82b1-04f593d3be0f","name":"Delete Message","originalRequest":{"method":"DELETE","header":[],"url":"http://localhost:5050/api/v1/messages/5d42cab81b1faddfad01294a"},"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":"162"},{"key":"ETag","value":"W/\"a2-jU4MIB+zlHjEpc1/Z0oxwCQJ/oU\""},{"key":"Date","value":"Fri, 02 Aug 2019 07:57:56 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": 200,\n    \"data\": {\n        \"_id\": \"5d42cab81b1faddfad01294a\",\n        \"message\": \"wacha wewe\",\n        \"sender\": \"5d414dc4872b8083d456a9cc\",\n        \"recipient\": \"5d414df4872b8083d456a9ce\",\n        \"__v\": 0\n    }\n}"}],"_postman_id":"812af494-5cc3-4208-98f5-da202982c997"}],"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]}},"event":[{"listen":"prerequest","script":{"id":"d1e1e4f1-78f3-4c97-b94b-4bb029f3d873","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"347d5d90-ed5f-475b-b9e6-62d53a59e75a","type":"text/javascript","exec":[""]}}],"variable":[{"key":"url","value":"http://localhost:5050/api/v1"}]}