{"info":{"_postman_id":"e5f8a1c5-fafa-4ed5-8ab1-b28054fbf7f3","name":"beer-api","description":"<html><head></head><body><h1 id=\"welcome-to-beer-api-documentation\">Welcome to beer-api documentation</h1>\n<p>beer-api is a REST API for a beer consumption logging application developed during my recruitment process at La Creativería.</p>\n<h2 id=\"built-with\">Built With</h2>\n<p>It was developed using amazing technologies:</p>\n<ul>\n<li><a href=\"https://nodejs.org/es/\">Node JS</a></li>\n<li><a href=\"https://expressjs.com/\">Express</a></li>\n<li><a href=\"https://jwt.io/\">JSON Web Tokens</a></li>\n<li><a href=\"https://mongoosejs.com/\">Mongoose</a></li>\n<li>And more...</li>\n</ul>\n<h2 id=\"getting-started\">Getting Started</h2>\n<h3 id=\"installation\">Installation</h3>\n<p><strong>Step 1:</strong> Clone or download the <a href=\"https://github.com/bryandms/beer-api\">repo</a>.</p>\n<br>\n\n<p><strong>Step 2:</strong> Switch to your repository's directory.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">cd /path/to/your/repo\n</code></pre>\n<br>\n\n<p><strong>Step 3:</strong> Install dependencies.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">npm install\n</code></pre>\n<br>\n\n<p><strong>Step 4:</strong> Duplicate the .env-example file and rename it to .env and change the environment variables.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">cp .env.example .env\n</code></pre>\n<br>\n\n<p><strong>Step 5:</strong> Run the server.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">npm run dev\n</code></pre>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Welcome to beer-api documentation","slug":"welcome-to-beer-api-documentation"}],"owner":"3139843","collectionId":"e5f8a1c5-fafa-4ed5-8ab1-b28054fbf7f3","publishedId":"T1DqfGja","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-07-26T03:40:19.000Z"},"item":[{"name":"Authentication","item":[{"name":"User sign up","id":"dbaefc7e-696e-489b-baed-6aa36e2d65dc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"email\": \"userone@example.com\",\n\t\"password\": \"beerapi\",\n\t\"name\": \"User One\"\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/auth/signup","description":"<blockquote>\n<p><strong>Note:</strong> <br /> Add the header <code>\"Content-type\":\"application/json\"</code> to your request</p>\n</blockquote>\n<p><em>Example with curl:</em></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location \\\n-H \"Content-Type: application/json\" \\\n--request POST 'https://beer-rest-api.herokuapp.com/api/auth/signup' \\\n--data-raw '{\n    \"email\": \"userone@example.com\",\n    \"password\": \"beerapi\",\n    \"name\": \"User One\"\n}'\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","auth","signup"],"host":["beer-rest-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"aee32176-c91c-4d52-b583-c4327bced7b0","name":"User sign up (Email address already exists)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"email\": \"userone@example.com\",\n\t\"password\": \"beerapi\",\n\t\"name\": \"User One\"\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/auth/signup"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"149"},{"key":"Etag","value":"W/\"95-3P5XMPkwyjaWzb1p26Bqx208v7s\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:25:52 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Could not create user.\",\n    \"data\": [\n        {\n            \"value\": \"userone@example.com\",\n            \"msg\": \"Email address already exists.\",\n            \"param\": \"email\",\n            \"location\": \"body\"\n        }\n    ]\n}"},{"id":"bb2c305f-2bf0-4834-9eee-f4af7255c306","name":"User sign up","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"email\": \"userone@example.com\",\n\t\"password\": \"beerapi\",\n\t\"name\": \"User One\"\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/auth/signup"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"76"},{"key":"Etag","value":"W/\"4c-2uwgL+J/n2j4KwrJy2zm4EC8ugo\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:07:58 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"User created successfully.\",\n    \"userId\": \"5f1ce57e541c7600178d6264\"\n}"},{"id":"ee4eb8a7-1fca-4150-acbb-4abb39a45a2d","name":"User sign up (Validation failed)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"email\": \"\",\n\t\"password\": \"beer\",\n\t\"name\": \"User One\"\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/auth/signup"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"234"},{"key":"Etag","value":"W/\"ea-MA0CRYbVxN05sEvV36JfnZpCLsU\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:27:06 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Could not create user.\",\n    \"data\": [\n        {\n            \"value\": \"\",\n            \"msg\": \"Please enter a valid email.\",\n            \"param\": \"email\",\n            \"location\": \"body\"\n        },\n        {\n            \"value\": \"beer\",\n            \"msg\": \"The password must be at least 6 characters.\",\n            \"param\": \"password\",\n            \"location\": \"body\"\n        }\n    ]\n}"}],"_postman_id":"dbaefc7e-696e-489b-baed-6aa36e2d65dc"},{"name":"User login","id":"5a5f21a8-2bbc-417b-8948-96ece660297c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"email\": \"userone@example.com\",\n\t\"password\": \"beerapi\"\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/auth/login","description":"<blockquote>\n<p><strong>Note:</strong> <br /> Add the header <code>\"Content-type\":\"application/json\"</code> to your request</p>\n</blockquote>\n<p><em>Example with curl:</em></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location \\\n-H \"Content-Type: application/json\" \\\n--request POST 'https://beer-rest-api.herokuapp.com/api/auth/login' \\\n--data-raw '{\n    \"email\": \"userone@example.com\",\n    \"password\": \"beerapi\"\n}'\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","auth","login"],"host":["beer-rest-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"06865620-109f-405e-aadf-e9f4ee523ea4","name":"User login","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"email\": \"userone@example.com\",\n\t\"password\": \"beerapi\"\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/auth/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"264"},{"key":"Etag","value":"W/\"108-IE39V382o0TjKX+AoC74OGF0EmE\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:21:04 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InVzZXJvbmVAZXhhbXBsZS5jb20iLCJ1c2VySWQiOiI1ZjFjZTU3ZTU0MWM3NjAwMTc4ZDYyNjQiLCJpYXQiOjE1OTU3MzAwNjQsImV4cCI6MTU5NTczMzY2NH0.FW1WBlh2UT7gNMueothMOg-49O0iA3fWMkAbzE5FAG8\",\n    \"userId\": \"5f1ce57e541c7600178d6264\"\n}"},{"id":"afb01514-6c5e-41fb-8aae-eb0ff72fea77","name":"User login (Failed)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"email\": \"useron@example.com\",\n\t\"password\": \"beerapi\"\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/auth/login"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"57"},{"key":"Etag","value":"W/\"39-DqXE6gN/4z2MxO1075dJf450wMw\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:29:32 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"These credentials do not match our records.\"\n}"}],"_postman_id":"5a5f21a8-2bbc-417b-8948-96ece660297c"}],"id":"8533b2f2-eaa6-4b55-a8b7-50a65bf484b4","description":"<p>beer-api protects resources from public access to allow only registered users to use it.</p>\n","event":[{"listen":"prerequest","script":{"id":"afa663a4-a913-4dd6-9f13-d0f50ed53c6d","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"494f87fb-879e-4a46-aa6e-453cc4684cb8","type":"text/javascript","exec":[""]}}],"_postman_id":"8533b2f2-eaa6-4b55-a8b7-50a65bf484b4"},{"name":"Beers","item":[{"name":"Beers collection","id":"1d2792e9-cdfd-471d-815f-6c8fc3fe248a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://beer-rest-api.herokuapp.com/api/beers?page=1","description":"<blockquote>\n<p><strong>Note:</strong> <br /> Add the header <code>\"Authorization\":\"Bearer token\"</code> to your request</p>\n</blockquote>\n<p><em>Example with curl:</em></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location  \\\n-H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InVzZXJvbmVAZXhhbXBsZS5jb20iLCJ1c2VySWQiOiI1ZjFjZTU3ZTU0MWM3NjAwMTc4ZDYyNjQiLCJpYXQiOjE1OTU3MzAwNjQsImV4cCI6MTU5NTczMzY2NH0.FW1WBlh2UT7gNMueothMOg-49O0iA3fWMkAbzE5FAG8\"  \\\n--request GET 'https://beer-rest-api.herokuapp.com/api/beers'\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","beers"],"host":["beer-rest-api","herokuapp","com"],"query":[{"key":"page","value":"1"}],"variable":[]}},"response":[{"id":"4ec6cc2c-4de6-476d-bbe1-fb68b27aaf77","name":"Beers collection (Pagination)","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://beer-rest-api.herokuapp.com/api/beers?page=2","protocol":"https","host":["beer-rest-api","herokuapp","com"],"path":["api","beers"],"query":[{"key":"page","value":"2"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"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-D/9dUiUwTSd8EAFrSLouy5I4+Ag\""},{"key":"Date","value":"Sun, 26 Jul 2020 03:42:58 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Beers fetched successfully.\",\n    \"beers\": [\n        {\n            \"alcoholPercentage\": 5,\n            \"consumptions\": [],\n            \"_id\": \"5f1cfbb9541c7600178d6270\",\n            \"type\": \"Artesanal\",\n            \"brand\": \"Ebrio\",\n            \"createdAt\": \"2020-07-26T03:42:49.445Z\",\n            \"updatedAt\": \"2020-07-26T03:42:49.445Z\",\n            \"__v\": 0\n        },\n        {\n            \"alcoholPercentage\": 5,\n            \"consumptions\": [],\n            \"_id\": \"5f1cfbba541c7600178d6271\",\n            \"type\": \"Artesanal\",\n            \"brand\": \"Ebrio\",\n            \"createdAt\": \"2020-07-26T03:42:50.256Z\",\n            \"updatedAt\": \"2020-07-26T03:42:50.256Z\",\n            \"__v\": 0\n        }\n    ],\n    \"totalItems\": 12\n}"},{"id":"a216dce9-017c-4125-b447-105325fce2af","name":"Beers collection (JWT expired)","originalRequest":{"method":"GET","header":[],"url":"https://beer-rest-api.herokuapp.com/api/beers"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"25"},{"key":"Etag","value":"W/\"19-NLxHdTmGtBwpH6O42txxhQPNwcM\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:37:12 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"jwt expired\"\n}"},{"id":"ca3a0fe5-4b3d-4a5d-a96d-fcdcea50f5ca","name":"Beers collection","originalRequest":{"method":"GET","header":[],"url":"https://beer-rest-api.herokuapp.com/api/beers"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"67"},{"key":"Etag","value":"W/\"43-hgSpeqVBnAsAHvGTeXwj6b5N4x8\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:34:00 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Beers fetched successfully.\",\n    \"beers\": [],\n    \"totalItems\": 0\n}"}],"_postman_id":"1d2792e9-cdfd-471d-815f-6c8fc3fe248a"},{"name":"Beer creation","id":"d79d446f-9b4c-44e9-ad03-25c4d1368379","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"type\": \"Artesanal\",\n\t\"brand\": \"OjoGacho\",\n\t\"alcoholPercentage\": 3\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/beers","description":"<blockquote>\n<p><strong>Note:</strong> <br /> Add the header <code>\"Authorization\":\"Bearer token\"</code> and <code>\"Content-Type\":\"application/json\"</code> to your request</p>\n</blockquote>\n<p><em>Example with curl:</em></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location \\\n-H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InVzZXJvbmVAZXhhbXBsZS5jb20iLCJ1c2VySWQiOiI1ZjFjZTU3ZTU0MWM3NjAwMTc4ZDYyNjQiLCJpYXQiOjE1OTU3MzAwNjQsImV4cCI6MTU5NTczMzY2NH0.FW1WBlh2UT7gNMueothMOg-49O0iA3fWMkAbzE5FAG8\"  \\\n-H \"Content-Type: application/json\" \\\n--request POST 'https://beer-rest-api.herokuapp.com/api/beers' \\\n--data-raw '{\n    \"type\": \"Artesanal\",\n    \"brand\": \"Ebrio\",\n    \"alcoholPercentage\": 5\n}'\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","beers"],"host":["beer-rest-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"5c3ccbb1-0b36-4711-92c1-5d0c18dfa87c","name":"Beer creation (JWT expired)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"type\": \"Artesanal\",\n\t\"brand\": \"Ebrio\",\n\t\"alcoholPercentage\": 5\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/beers"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"25"},{"key":"Etag","value":"W/\"19-NLxHdTmGtBwpH6O42txxhQPNwcM\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:44:40 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"jwt expired\"\n}"},{"id":"948d9bab-7616-40bd-81a2-75c0654c12fc","name":"Beer creation","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"type\": \"Artesanal\",\n\t\"brand\": \"Ebrio\",\n\t\"alcoholPercentage\": 5\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/beers"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"243"},{"key":"Etag","value":"W/\"f3-isH+SxAOOwlXSS2R/KMa2IpLs5Y\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:44:06 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Beer created successfully.\",\n    \"beer\": {\n        \"alcoholPercentage\": 5,\n        \"consumptions\": [],\n        \"_id\": \"5f1cedf6541c7600178d6265\",\n        \"type\": \"Artesanal\",\n        \"brand\": \"Ebrio\",\n        \"createdAt\": \"2020-07-26T02:44:06.178Z\",\n        \"updatedAt\": \"2020-07-26T02:44:06.178Z\",\n        \"__v\": 0\n    }\n}"}],"_postman_id":"d79d446f-9b4c-44e9-ad03-25c4d1368379"},{"name":"Beer detail","id":"d85fa5d5-44ad-46dc-8a98-09ab715ba768","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://beer-rest-api.herokuapp.com/api/beers/5f1ef8423a97b800175d77c2","description":"<blockquote>\n<p><strong>Note:</strong> <br /> Add the header <code>\"Authorization\":\"Bearer token\"</code> and <code>\"Content-Type\":\"application/json\"</code> to your request</p>\n</blockquote>\n<p><em>Example with curl:</em></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location \\\n-H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InVzZXJvbmVAZXhhbXBsZS5jb20iLCJ1c2VySWQiOiI1ZjFjZTU3ZTU0MWM3NjAwMTc4ZDYyNjQiLCJpYXQiOjE1OTU3MzAwNjQsImV4cCI6MTU5NTczMzY2NH0.FW1WBlh2UT7gNMueothMOg-49O0iA3fWMkAbzE5FAG8\"  \\\n-H \"Content-Type: application/json\" \\\n--request GET 'https://beer-rest-api.herokuapp.com/api/beers/5f1cedf6541c7600178d6265'\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","beers","5f1ef8423a97b800175d77c2"],"host":["beer-rest-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"1b718396-0cc6-4a6c-b3c9-79379519ea6d","name":"Beer detail (JWT expired)","originalRequest":{"method":"GET","header":[],"url":"https://beer-rest-api.herokuapp.com/api/beers/5f1cc402b0b3000017b43a1e"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"25"},{"key":"Etag","value":"W/\"19-NLxHdTmGtBwpH6O42txxhQPNwcM\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:47:21 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"jwt expired\"\n}"},{"id":"2201e20d-ec25-457e-99d2-ddc228067a20","name":"Beer detail","originalRequest":{"method":"GET","header":[],"url":"https://beer-rest-api.herokuapp.com/api/beers/5f1cedf6541c7600178d6265"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"230"},{"key":"Etag","value":"W/\"e6-NuGNxo//bHVDkkNtmt/YwMiLK8o\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:46:15 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Beer fetched.\",\n    \"beer\": {\n        \"alcoholPercentage\": 5,\n        \"_id\": \"5f1cedf6541c7600178d6265\",\n        \"type\": \"Artesanal\",\n        \"brand\": \"Ebrio\",\n        \"createdAt\": \"2020-07-26T02:44:06.178Z\",\n        \"updatedAt\": \"2020-07-26T02:44:06.178Z\",\n        \"__v\": 0,\n        \"totalConsumed\": 0\n    }\n}"},{"id":"57cbdf85-78d6-4537-af6b-799f91b3d256","name":"Beer detail (Could not find beer)","originalRequest":{"method":"GET","header":[],"url":"https://beer-rest-api.herokuapp.com/api/beers/5f1cc402b0b3000017b43a1e"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"34"},{"key":"Etag","value":"W/\"22-cOg0Vt5EATFn/cnSwfS4JtGXwiI\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:46:49 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Could not find beer.\"\n}"}],"_postman_id":"d85fa5d5-44ad-46dc-8a98-09ab715ba768"},{"name":"Beer updating","id":"28c28d5f-9dfe-4cd6-bfbd-f85ef9cc22e4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n\t\"type\": \"Artesanal\",\n\t\"brand\": \"Ebrios\",\n\t\"alcoholPercentage\": 4\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/beers/5f1ef82e3a97b800175d77c1","description":"<blockquote>\n<p><strong>Note:</strong> <br /> Add the header <code>\"Authorization\":\"Bearer token\"</code> and <code>\"Content-Type\":\"application/json\"</code> to your request</p>\n</blockquote>\n<p><em>Example with curl:</em></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location \\\n-H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InVzZXJvbmVAZXhhbXBsZS5jb20iLCJ1c2VySWQiOiI1ZjFjZTU3ZTU0MWM3NjAwMTc4ZDYyNjQiLCJpYXQiOjE1OTU3MzAwNjQsImV4cCI6MTU5NTczMzY2NH0.FW1WBlh2UT7gNMueothMOg-49O0iA3fWMkAbzE5FAG8\"  \\\n-H \"Content-Type: application/json\" \\\n--request PUT 'https://beer-rest-api.herokuapp.com/api/beers/5f1cedf6541c7600178d6265' \\\n--data-raw '{\n    \"type\": \"Artesanal\",\n    \"brand\": \"Ebrio\",\n    \"alcoholPercentage\": 4\n}'\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","beers","5f1ef82e3a97b800175d77c1"],"host":["beer-rest-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"1baa7bc6-28bd-442a-a5be-7c09bac0b0b6","name":"Beer updating (Could not find beer)","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n\t\"type\": \"Artesanal\",\n\t\"brand\": \"Ebrio\",\n\t\"alcoholPercentage\": 4\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/beers/5f1cc402b0b3000017b43a1e"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"34"},{"key":"Etag","value":"W/\"22-cOg0Vt5EATFn/cnSwfS4JtGXwiI\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:53:27 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Could not find beer.\"\n}"},{"id":"46ea36c4-3edf-43f0-b2d9-c2a45bd8c13a","name":"Beer updating","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n\t\"type\": \"Artesanal\",\n\t\"brand\": \"Ebrio\",\n\t\"alcoholPercentage\": 4\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/beers/5f1cedf6541c7600178d6265"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"243"},{"key":"Etag","value":"W/\"f3-JkrcYwCM7R0Ft7bUmMe0QoGE9hU\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:50:20 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Beer updated successfully.\",\n    \"beer\": {\n        \"alcoholPercentage\": 4,\n        \"consumptions\": [],\n        \"_id\": \"5f1cedf6541c7600178d6265\",\n        \"type\": \"Artesanal\",\n        \"brand\": \"Ebrio\",\n        \"createdAt\": \"2020-07-26T02:44:06.178Z\",\n        \"updatedAt\": \"2020-07-26T02:50:20.162Z\",\n        \"__v\": 0\n    }\n}"},{"id":"614a1b55-1b13-409d-a612-db81d22e08da","name":"Beer updating (JWT expired)","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n\t\"type\": \"Artesanal\",\n\t\"brand\": \"Ebrio\",\n\t\"alcoholPercentage\": 4\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/beers/5f1cc402b0b3000017b43a1e"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"25"},{"key":"Etag","value":"W/\"19-NLxHdTmGtBwpH6O42txxhQPNwcM\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:52:01 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"jwt expired\"\n}"}],"_postman_id":"28c28d5f-9dfe-4cd6-bfbd-f85ef9cc22e4"}],"id":"db1cf43d-acda-4f05-87ed-24d5e7aa6efe","_postman_id":"db1cf43d-acda-4f05-87ed-24d5e7aa6efe","description":""},{"name":"consumptions","item":[{"name":"Consumption creation","id":"28a1e9ef-da83-4609-8411-0afe48319b47","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"quantity\": 1,\n\t\"beerId\": \"5f1ef8423a97b800175d77c2\"\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/consumptions","description":"<blockquote>\n<p><strong>Note:</strong> <br /> Add the header <code>\"Authorization\":\"Bearer token\"</code> and <code>\"Content-Type\":\"application/json\"</code> to your request</p>\n</blockquote>\n<p><em>Example with curl:</em></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location \\\n-H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InVzZXJvbmVAZXhhbXBsZS5jb20iLCJ1c2VySWQiOiI1ZjFjZTU3ZTU0MWM3NjAwMTc4ZDYyNjQiLCJpYXQiOjE1OTU3MzAwNjQsImV4cCI6MTU5NTczMzY2NH0.FW1WBlh2UT7gNMueothMOg-49O0iA3fWMkAbzE5FAG8\"  \\\n-H \"Content-Type: application/json\" \\\n--request POST 'https://beer-rest-api.herokuapp.com/api/consumptions' \\\n--data-raw '{\n    \"quantity\": 2,\n    \"beerId\": \"5f1cedf6541c7600178d6265\"\n}'\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","consumptions"],"host":["beer-rest-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"848d9e35-5997-405d-b8da-e963b1b08fa4","name":"Consumption creation","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"quantity\": 2,\n\t\"beerId\": \"5f1cedf6541c7600178d6265\"\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/consumptions"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"263"},{"key":"Etag","value":"W/\"107-XKF9h+nl5FUEKEmMj22uGJKF/lM\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:54:45 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Consumption created successfully.\",\n    \"consumption\": {\n        \"quantity\": 2,\n        \"_id\": \"5f1cf075541c7600178d6266\",\n        \"user\": \"5f1ce57e541c7600178d6264\",\n        \"beer\": \"5f1cedf6541c7600178d6265\",\n        \"createdAt\": \"2020-07-26T02:54:45.705Z\",\n        \"updatedAt\": \"2020-07-26T02:54:45.705Z\",\n        \"__v\": 0\n    }\n}"},{"id":"8cbdbdf9-e36e-425e-bd79-7d9afb632e83","name":"Consumption creation (Could not find beer)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"quantity\": 2,\n\t\"beerId\": \"5f1cc402b0b3000017b43a1e\"\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/consumptions"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"34"},{"key":"Etag","value":"W/\"22-cOg0Vt5EATFn/cnSwfS4JtGXwiI\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:55:58 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Could not find beer.\"\n}"},{"id":"d3c1492d-c6c4-42fc-b17c-b7607ae7285f","name":"Consumption creation (JWT expired)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n\t\"quantity\": 2,\n\t\"beerId\": \"5f1cc402b0b3000017b43a1e\"\n}","options":{"raw":{"language":"json"}}},"url":"https://beer-rest-api.herokuapp.com/api/consumptions"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"25"},{"key":"Etag","value":"W/\"19-NLxHdTmGtBwpH6O42txxhQPNwcM\""},{"key":"Date","value":"Sun, 26 Jul 2020 02:55:13 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"jwt expired\"\n}"}],"_postman_id":"28a1e9ef-da83-4609-8411-0afe48319b47"},{"name":"Get total consumed by user","id":"cb1eabe3-f46f-4788-b74d-c9827d25abf7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://beer-rest-api.herokuapp.com/api/totalConsumed","description":"<blockquote>\n<p><strong>Note:</strong> <br /> Add the header <code>\"Authorization\":\"Bearer token\"</code> to your request</p>\n</blockquote>\n<p><em>Example with curl:</em></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">curl --location \\\n-H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InVzZXJvbmVAZXhhbXBsZS5jb20iLCJ1c2VySWQiOiI1ZjFjZTU3ZTU0MWM3NjAwMTc4ZDYyNjQiLCJpYXQiOjE1OTU3MzAwNjQsImV4cCI6MTU5NTczMzY2NH0.FW1WBlh2UT7gNMueothMOg-49O0iA3fWMkAbzE5FAG8\"  \\\n--request GET 'https://beer-rest-api.herokuapp.com/api/totalConsumed'\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","totalConsumed"],"host":["beer-rest-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"14b2a097-bc3e-4501-83e5-60f1f8c4c4ac","name":"Get total consumed by user","originalRequest":{"method":"GET","header":[],"url":"https://beer-rest-api.herokuapp.com/api/totalConsumed"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Cowboy"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Access-Control-Allow-Methods","value":"OPTIONS, GET, POST, PUT, PATCH, DELETE"},{"key":"Access-Control-Allow-Headers","value":"Content-Type, Authorization"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"55"},{"key":"Etag","value":"W/\"37-NA8qsvE1aHzGLvdHdYQnHLVCscE\""},{"key":"Date","value":"Mon, 27 Jul 2020 15:56:09 GMT"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Total consumed fetched.\",\n    \"totalConsumed\": 3\n}"}],"_postman_id":"cb1eabe3-f46f-4788-b74d-c9827d25abf7"}],"id":"70034173-e5c3-4388-93a3-83f430215c19","_postman_id":"70034173-e5c3-4388-93a3-83f430215c19","description":""}],"event":[{"listen":"prerequest","script":{"id":"9cd6b2e7-9615-441d-923e-ee19f42c1f0a","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"0c71ae4c-a4d0-4c92-ab4f-d7365b823abf","type":"text/javascript","exec":[""]}}]}