{"info":{"_postman_id":"c9d59eae-a046-478c-a8c1-fb6087af232c","name":"Macro-Calculator","description":"<html><head></head><body><h1 id=\"vision\">Vision</h1>\n<p>Register, login, and access user information for macro calculator application</p>\n<h1 id=\"about\">About</h1>\n<p>To contribute or utiilize this project, clone and download the git repository. Run <code>npm install</code> to download the necessary dependencies. Run <code>npm run server</code> in the command line to start the server on localhost:5000.</p>\n<h1 id=\"authentication\">Authentication</h1>\n<p>Leverage /auth/register or /auth/login to authenticate with the app and receive a token for accessing the user information routes.</p>\n<h1 id=\"http-status-codes\">HTTP Status Codes</h1>\n<ul>\n<li><code>200 OK</code><ul>\n<li>The request has succeeded</li>\n</ul>\n</li>\n<li><code>201 Created</code><ul>\n<li>The request succeedded and the new resource has been created</li>\n</ul>\n</li>\n<li><code>400 Bad Request</code>\n  -The server could not understand the request due to invalid syntax\n  -The most likely cause is an improper request body\n-<code>401 Unauthorized</code>\n  -No authentication header was provided with the request</li>\n<li><code>404 Not found</code>\n  -The server could not find the requested source</li>\n<li><code>500 Internal Server Error</code>\n  -The server has encountered a situation it doesn't know how to handle</li>\n</ul>\n<h1 id=\"rate-limit\">Rate limit</h1>\n<p>None</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Vision","slug":"vision"},{"content":"About","slug":"about"},{"content":"Authentication","slug":"authentication"},{"content":"HTTP Status Codes","slug":"http-status-codes"},{"content":"Rate limit","slug":"rate-limit"}],"owner":"9286218","collectionId":"c9d59eae-a046-478c-a8c1-fb6087af232c","publishedId":"SW7Z2nhd","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2019-11-19T05:58:54.000Z"},"item":[{"name":"https://bw-macro-calculator.herokuapp.com/auth/register","id":"59fb0681-fab6-48ef-a823-005915e765d5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"authorization","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoyMiwidXNlcm5hbWUiOiJ0ZXN0aW5nIiwicGFzc3dvcmQiOiIkMmEkMTAkSi9uUlpWaW91ZmhUU05udmJ3dmdtLmZKeWlXMHBtbDhNeTJvZllnekI1V1dLMTloR2taTHkiLCJmdWxsbmFtZSI6InRlc3RpbmcifSwiaWF0IjoxNTc0MjA5NzE3LCJleHAiOjE1NzQyMzg1MTd9.1sziAniMJWnHnAcLPd5wue4CxuB5XsnD_zOacSykq7Q","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"fullname\": \"Steven J\",\n\t\"username\": \"stevej\",\n\t\"password\": \"password\"\n}","options":{"raw":{"language":"json"}}},"url":"https://bw-macro-calculator.herokuapp.com/auth/login","description":"<p>Register and authenticate a new user</p>\n<p>Example request body: \n<code>{     \"fullname\": \"jane doe\",     \"username\": \"jane\",     \"password\": 'password' }</code></p>\n<p>Subsequent login not required. Returns an Object with user and token key:value paris. Example response body:</p>\n<p><code>{     \"user_id\": 32,     \"fullname\": \"jane doe\",     \"username\": \"jane\",     \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjozMiwidXNlcm5hbWUiOiJkb20yIiwicGFzc3dvcmQiOiIkMmEkMTAkakFXSGxudjZ4Q1licTJidUVZaDBxZXpkYXZvbE95S3BWUmdIbGM2R21iam9jNnpXeWlQREsiLCJmdWxsbmFtZSI6InRlc3QifSwiaWF0IjoxNTc0MjEzMzQ4LCJleHAiOjE1NzQyNDIxNDh9.heeTsB275Eng6WMc1nHzYf06xXww6Bl3yqmPjtK8mRk\" } </code></p>\n<p>REQUIRED fields: <code>fullname</code>,<code>username</code>, <code>password</code></p>\n","urlObject":{"protocol":"https","path":["auth","login"],"host":["bw-macro-calculator","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"6cab0a0b-6522-408f-8a53-fa6c9b793828","name":"Default","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":""},"url":"https://bw-macro-calculator.herokuapp.com/auth/register"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":""}],"_postman_id":"59fb0681-fab6-48ef-a823-005915e765d5"},{"name":"https://bw-macro-calculator.herokuapp.com/auth/login","id":"b9c9d03f-3234-4a54-a79a-067da2bc1498","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":""},"url":"https://bw-macro-calculator.herokuapp.com/auth/login","description":"<p>Login with a registered account</p>\n<p>Returns an Object with user and token key:value paris.\nExample request body:\n`\n{</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>\"username\": \"jane\",\n\"password\": \"password\"\n</code></pre><p>}\n`</p>\n<p>Example response boody:</p>\n<p><code>{     \"user_id\": 32,     \"fullname\": \"jane doe\",     \"username\": \"jane\",     \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjozMiwidXNlcm5hbWUiOiJkb20yIiwicGFzc3dvcmQiOiIkMmEkMTAkakFXSGxudjZ4Q1licTJidUVZaDBxZXpkYXZvbE95S3BWUmdIbGM2R21iam9jNnpXeWlQREsiLCJmdWxsbmFtZSI6InRlc3QifSwiaWF0IjoxNTc0MjEzNDExLCJleHAiOjE1NzQyNDIyMTF9.fIRHVNQzQaYVc0iMbLWgzg2gBiJKRY0Yjep1eX7erWE\" }</code></p>\n<p>REQUIRED field <code>username</code>, <code>password</code></p>\n","urlObject":{"protocol":"https","path":["auth","login"],"host":["bw-macro-calculator","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"6d4e2011-e427-4f2a-bcd5-f3c4f9d11e5e","name":"Default","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":""},"url":"https://bw-macro-calculator.herokuapp.com/auth/login"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":""}],"_postman_id":"b9c9d03f-3234-4a54-a79a-067da2bc1498"},{"name":"https://bw-macro-calculator.herokuapp.com/info","id":"e9397e31-9cee-4786-b687-9517a20ea922","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":""},"url":"https://bw-macro-calculator.herokuapp.com/info","description":"<p>Create a new uesr information object</p>\n<p>Requires authorization.</p>\n<p>req.header.authorization = token;</p>\n<p>Example request body:</p>\n<p><code>{     \"birthdate_day\": 10,     \"birthdate_month\": 2,     \"birthdate_year\": 2000,     \"gender\": \"female\",     \"height\": \"69\",     \"weight\": \"145\",     \"activity_factor\": \"1.9\",     \"meals_per_day\": 3,     \"snacks_per_day\": 0,     \"goal_multiplier\": \"1.1\" }</code></p>\n<p>REQUIRED fields: <code>birthdate_day</code>, <code>birthdate_month</code>, <code>birthdate_year</code>,<code>gender</code>, <code>height</code>, <code>weight</code>, <code>activity_factor</code>, <code>meals_per_day</code>, <code>snacks_per_day</code>, <code>goal_multiplier</code></p>\n<p>Returns the new user information. Example response body:</p>\n<p><code>{     \"id\": 1     \"user_id\": 1,     \"birthdate_day\": 10,     \"birthdate_month\": 2,     \"birthdate_year\": 2000,     \"gender\": \"female\",     \"height\": \"69\",     \"weight\": \"145\",     \"activity_factor\": \"1.9\",     \"meals_per_day\": 3,     \"snacks_per_day\": 0,     \"goal_multiplier\": \"1.1\" } </code></p>\n","urlObject":{"protocol":"https","path":["info"],"host":["bw-macro-calculator","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"aa74547c-5421-4046-bc42-f16623d13e9b","name":"Default","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":""},"url":"https://bw-macro-calculator.herokuapp.com/info"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":""}],"_postman_id":"e9397e31-9cee-4786-b687-9517a20ea922"},{"name":"https://bw-macro-calculator.herokuapp.com/info/:id","id":"ebc92516-78aa-4bf5-8e01-b975bc71a719","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"https://bw-macro-calculator.herokuapp.com/info/:id","description":"<p>Get a user information object by ID</p>\n<p>Requires authorization.</p>\n<p>req.headers.authorization = token;</p>\n<p>Return the user information object:</p>\n<p><code>{     \"id\": 4,     \"user_id\": 32,     \"birthdate_day\": 12,     \"birthdate_month\": 6,     \"birthdate_year\": 1965,     \"gender\": \"male\",     \"height\": 70,     \"weight\": 135,     \"activity_factor\": 1.725,     \"meals_per_day\": 3,     \"snacks_per_day\": 0,     \"goal_multiplier\": 1 } </code></p>\n","urlObject":{"protocol":"https","path":["info",":id"],"host":["bw-macro-calculator","herokuapp","com"],"query":[],"variable":[{"type":"any","key":"id"}]}},"response":[{"id":"3074cda0-c28b-4d7b-936b-1ea429e92e5a","name":"Default","originalRequest":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"https://bw-macro-calculator.herokuapp.com/info/:id","protocol":"https","host":["bw-macro-calculator","herokuapp","com"],"path":["info",":id"],"variable":[{"key":"id"}]}},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":""}],"_postman_id":"ebc92516-78aa-4bf5-8e01-b975bc71a719"},{"name":"https://bw-macro-calculator.herokuapp.com/info/:id.","id":"8c259de5-54d0-4609-bf12-39faa772f4f4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":""},"url":"https://bw-macro-calculator.herokuapp.com/info/:id","description":"<p>Edit a user information object by ID.</p>\n<p>Requires authorization.</p>\n","urlObject":{"protocol":"https","path":["info",":id"],"host":["bw-macro-calculator","herokuapp","com"],"query":[],"variable":[{"type":"any","key":"id"}]}},"response":[{"id":"22dc01e2-6b6f-49c2-b8e6-1d2cd0414611","name":"Default","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"https://bw-macro-calculator.herokuapp.com/info/:id","protocol":"https","host":["bw-macro-calculator","herokuapp","com"],"path":["info",":id"],"variable":[{"key":"id"}]}},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":""}],"_postman_id":"8c259de5-54d0-4609-bf12-39faa772f4f4"},{"name":"https://bw-macro-calculator.herokuapp.com/info/:id","id":"22b8eb8a-7065-4f3c-9cc1-bdaae2b708f6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":""},"url":"https://bw-macro-calculator.herokuapp.com/info/:id","description":"<p>Delete user information object by ID.</p>\n<p>Requires authorization.</p>\n","urlObject":{"protocol":"https","path":["info",":id"],"host":["bw-macro-calculator","herokuapp","com"],"query":[],"variable":[{"type":"any","key":"id"}]}},"response":[{"id":"2bb2933f-8751-4dc8-b4d9-5ab2ee62d9a6","name":"Default","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"https://bw-macro-calculator.herokuapp.com/info/:id","protocol":"https","host":["bw-macro-calculator","herokuapp","com"],"path":["info",":id"],"variable":[{"key":"id"}]}},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":""}],"_postman_id":"22b8eb8a-7065-4f3c-9cc1-bdaae2b708f6"},{"name":"https://bw-macro-calculator.herokuapp.com/info/all","id":"1e9a3540-b61a-437c-a0a5-ea5c53d51360","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"https://bw-macro-calculator.herokuapp.com/info","description":"<p>Testing endpoint that retrieves all user informations</p>\n","urlObject":{"protocol":"https","path":["info"],"host":["bw-macro-calculator","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"a683d81f-3b59-4492-b09c-1f2c6e083dbe","name":"Default","originalRequest":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"https://bw-macro-calculator.herokuapp.com/info"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":""}],"_postman_id":"1e9a3540-b61a-437c-a0a5-ea5c53d51360"}],"event":[{"listen":"prerequest","script":{"id":"d401a806-dc0d-457f-9fb7-da4d39ff4e30","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"53133627-d70e-4316-aa53-c218e3f2f6ab","type":"text/javascript","exec":[""]}}]}