{"info":{"_postman_id":"4c631d86-ca39-41b8-9ab9-d1b222844862","name":"Ab-inbev backend test","description":"<html><head></head><body><p>Backend developer test\nThis is the documentation for the APIs</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"7357882","collectionId":"4c631d86-ca39-41b8-9ab9-d1b222844862","publishedId":"TzY68EBR","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-06-06T13:37:29.000Z"},"item":[{"name":"User signup","id":"0e2bb6e1-0cdc-4a45-beda-9c245a6db651","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"phawazzzy8@gmail.com\",\n    \"password\": \"Hardemola29;\",\n    \"username\": \"phawazzzy\"\n}","options":{"raw":{"language":"json"}}},"url":"https://abindev-test.herokuapp.com/api/v1/auth/signup","description":"<p>ENDPOINT:\n/api/v1/auth/signup</p>\n<p>This endpoint is for Registering a new user.\nIt accept only 3 payloads passed through in the body of the request.\nEach body payload has a validation </p>\n<ul>\n<li>email</li>\n<li>password<ul>\n<li>this must have atleast one uppercase, one number and one special character<ul>\n<li>special characters are !@#$%^&amp;*;</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>username</li>\n</ul>\n<p>There are different response for each error that might be encountered\ncheck the examples response in the top right corner of the page</p>\n","urlObject":{"path":["api","v1","auth","signup"],"host":["https://abindev-test.herokuapp.com"],"query":[],"variable":[]}},"response":[{"id":"04cda667-17d9-4488-999e-f43a121e349a","name":"response:: Missing payload parameters","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/auth/signup"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"90"},{"key":"ETag","value":"W/\"5a-S0cFltDcN82j1RfzQ8GggE5ayh8\""},{"key":"Date","value":"Sat, 05 Jun 2021 21:37:17 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": [\n        \"\\\"email\\\" is required\",\n        \"\\\"password\\\" is required\",\n        \"\\\"user name\\\" is required\"\n    ]\n}"},{"id":"a2f8ffca-8a77-4ff3-aaa9-5e56bb08748b","name":"response:: successful","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"newuser897@gmail.com\",\n    \"password\": \"Hardemola29;\",\n    \"username\": \"phawazzzy\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/auth/signup"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"317"},{"key":"ETag","value":"W/\"13d-X3fkfa9bS5nNcAuHou6yR9hWzG4\""},{"key":"Date","value":"Sat, 05 Jun 2021 22:42:53 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": true,\n    \"message\": \"Authentication successfull\",\n    \"data\": {\n        \"email\": \"newuser897@gmail.com\",\n        \"username\": \"phawazzzy\",\n        \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MGJiZmRlY2NjNTUyYTNkNzFiNjI2ZGMiLCJpYXQiOjE2MjI5MzI5NzMsImV4cCI6MTYyMjk1NDU3M30.cb8tFm8akNRWZmGTO0ExQBu_mg91NEQ-wUip3ppLCNk\"\n    },\n    \"error\": null\n}"},{"id":"82f40539-d131-4c5a-8e50-3f7e06715e07","name":"response::: Forbidden email address","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"newuser897@gmail.com\",\n    \"password\": \"Hardemola29;\",\n    \"username\": \"phawazzzy\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/auth/signup"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"134"},{"key":"ETag","value":"W/\"86-bl1FeEhkHd1XuHwh/yGw4PQHBMI\""},{"key":"Date","value":"Sat, 05 Jun 2021 23:09:03 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": false,\n    \"message\": \"user with this email address exists\",\n    \"data\": null,\n    \"error\": {\n        \"message\": \"user with this email address exists\"\n    }\n}"}],"_postman_id":"0e2bb6e1-0cdc-4a45-beda-9c245a6db651"},{"name":"User login","id":"86e3fc57-f58e-4e12-9aad-f1e1dbf50927","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"phawazzzy@gmail.com\",\n    \"password\": \"Hardemola29;\"\n}","options":{"raw":{"language":"json"}}},"url":"https://abindev-test.herokuapp.com/api/v1/auth/login","description":"<p>ENDPOINT: /api/v1/auth/login</p>\n<p>This endpoint is for login in a new user. It accept only 2 payloads passed through in the body of the request. Each body payload has a validation</p>\n<p>email\npassword</p>\n<p>There are different response for each error that might be encountered check the examples response in the top right corner of the page</p>\n","urlObject":{"path":["api","v1","auth","login"],"host":["https://abindev-test.herokuapp.com"],"query":[],"variable":[]}},"response":[{"id":"e3683c2c-c925-4398-916c-c8916ab24871","name":"response::: Missing payload","originalRequest":{"method":"POST","header":[],"url":"localhost:3000/api/v1/auth/login"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"62"},{"key":"ETag","value":"W/\"3e-wIjNz6/RZGkBKDvvNZe4APTGDbI\""},{"key":"Date","value":"Sat, 05 Jun 2021 23:47:23 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": [\n        \"\\\"email\\\" is required\",\n        \"\\\"password\\\" is required\"\n    ]\n}"},{"id":"99f8310e-5aa3-4f26-b2a8-3a1cce278a9f","name":"response::: user email not exist","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"phawazzzy@gmail.com\",\n    \"password\": \"Hardemola29;\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/auth/login"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"102"},{"key":"ETag","value":"W/\"66-5R8ETUmAosiskP5SqSboEZwCHz4\""},{"key":"Date","value":"Sat, 05 Jun 2021 23:50:58 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": false,\n    \"message\": \"User does not exist\",\n    \"data\": null,\n    \"error\": {\n        \"message\": \"User does not exist\"\n    }\n}"},{"id":"da6a0bc5-27df-4b1c-b37f-067808731ff2","name":"response::: invalid login credentials","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"newuser86@gmail.com\",\n    \"password\": \"Hardemola29\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/auth/login"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"188"},{"key":"ETag","value":"W/\"bc-9J8Iih2kbCXmUd/x9X1y0bDmqyI\""},{"key":"Date","value":"Sat, 05 Jun 2021 23:52:09 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": false,\n    \"message\": \"invalid login credentials, please check your email or password\",\n    \"data\": null,\n    \"error\": {\n        \"message\": \"invalid login credentials, please check your email or password\"\n    }\n}"},{"id":"bcda6a9c-0a0d-44b2-a1de-aa9d4c815238","name":"response::: successfull","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"newuser86@gmail.com\",\n    \"password\": \"Hardemola29;\"\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/auth/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"375"},{"key":"ETag","value":"W/\"177-OCcTl5LmxU1KdEiq+UP73b8lgm8\""},{"key":"Date","value":"Sat, 05 Jun 2021 23:54:37 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": true,\n    \"message\": \"Authentication successfully\",\n    \"data\": {\n        \"user\": {\n            \"_id\": \"60bc073b02cdf2425e4f17a7\",\n            \"email\": \"newuser86@gmail.com\",\n            \"password\": null,\n            \"username\": \"phawazzzy\"\n        },\n        \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MGJjMDczYjAyY2RmMjQyNWU0ZjE3YTciLCJpYXQiOjE2MjI5MzcyNzcsImV4cCI6MTYyMjk1ODg3N30.D6BwAuEC3I4Emg9tDnPeAWM7wJPeLEYMnEbooG_sTx4\"\n    },\n    \"error\": null\n}"}],"_postman_id":"86e3fc57-f58e-4e12-9aad-f1e1dbf50927"},{"name":"calculate area","id":"72d0ab98-5aa7-452e-bb7a-d3b6f3e9028d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"shape\": \"rectangle\",\n    \"dimensions\": {\n        \"length\": 3,\n        \"breadth\": 4\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://abindev-test.herokuapp.com/api/v1/calculate/","description":"<p>This endpoint is used for making calculations of the shapes</p>\n<h2 id=\"endpoint\">ENDPOINT:</h2>\n<p>/api/v1/calculate.</p>\n<p>user must be authenticated to access the endpoint</p>\n<h3 id=\"payloads\">payloads:</h3>\n<ul>\n<li>shapes </li>\n<li>dimensions</li>\n</ul>\n<p>The dimensions are different base on the provided shapes</p>\n<h3 id=\"shapes-and-dimension\">shapes and dimension</h3>\n<ol>\n<li><p>square.</p>\n<p>dimensions</p>\n<ul>\n<li>side</li>\n</ul>\n</li>\n<li><p>rectangle.</p>\n<p>dimensions</p>\n<ul>\n<li>length</li>\n<li>breadth</li>\n</ul>\n</li>\n<li><p>triangle.</p>\n<p>dimensions</p>\n<ul>\n<li>length_a</li>\n<li>length_b</li>\n<li>length_c</li>\n</ul>\n</li>\n<li><p>circle</p>\n<p>dimensions</p>\n<ul>\n<li>radius</li>\n</ul>\n</li>\n</ol>\n<p>There are different response for each error that might be encountered check the examples response in the top right corner of the page</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"4c631d86-ca39-41b8-9ab9-d1b222844862","id":"4c631d86-ca39-41b8-9ab9-d1b222844862","name":"Ab-inbev backend test","type":"collection"}},"urlObject":{"path":["api","v1","calculate",""],"host":["https://abindev-test.herokuapp.com"],"query":[],"variable":[]}},"response":[{"id":"cf5e196c-12a1-4583-a235-1488bdc4f797","name":"response::: Missing payload","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/calculate/"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"63"},{"key":"ETag","value":"W/\"3f-/u71jdPSssr2JguAvFXYk662yfI\""},{"key":"Date","value":"Sun, 06 Jun 2021 08:52:49 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": [\n        \"\\\"shape\\\" is required\",\n        \"\\\"dimension\\\" is required\"\n    ]\n}"},{"id":"559a951f-1eb9-4bb5-a702-ded16a2a3dcd","name":"response::: invalid token","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"shape\": \"Square\",\n    \"dimensions\": {\n        \"Side\": 3\n    }\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/calculate/"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"67"},{"key":"ETag","value":"W/\"43-QtORYCVw8F7GKIf2O34iwokhZ5Y\""},{"key":"Date","value":"Sun, 06 Jun 2021 08:55:08 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": false,\n    \"message\": \"Sorry, you must provide a valid token.\"\n}"},{"id":"81c17271-cbcf-466a-9f1f-e80b9e2b5ff6","name":"response:: success - rectangle","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"shape\": \"Rectangle\",\n    \"dimensions\": {\n        \"length\": 3,\n        \"breadth\": 4\n    }\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/calculate/"},"status":"Success","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"108"},{"key":"ETag","value":"W/\"6c-2wgl7kQh9nHnqfkSqkTA+JqVaE0\""},{"key":"Date","value":"Sun, 06 Jun 2021 09:49:42 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": true,\n    \"message\": \"Succesfully calculated area of the shape\",\n    \"data\": {\n        \"calculation\": {\n            \"_id\": \"60bce4a00bbebe6c75281721\",\n            \"user\": \"60bce4240bbebe6c7528171d\",\n            \"shape\": \"Rectangle\",\n            \"dimensions\": {\n                \"length\": 3,\n                \"breadth\": 4\n            },\n            \"calculation\": \"3 * 4\",\n            \"formula\": \"length * breadth\",\n            \"area\": 12,\n            \"__v\": 0\n        }\n    },\n    \"error\": null\n}"},{"id":"98bffe72-50dd-4341-a1e9-05f52e70a9d7","name":"response:: success - triangle","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"shape\": \"Triangle\",\n    \"dimensions\": {\n        \"length_a\": 3,\n        \"length_b\": 4,\n        \"length_c\": 4\n    }\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/calculate/"},"status":"Success","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"123"},{"key":"ETag","value":"W/\"7b-bWhWr2zjRbRXjEgkT6vxEeUi3Is\""},{"key":"Date","value":"Sun, 06 Jun 2021 09:51:11 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": true,\n    \"message\": \"Succesfully calculated area of the shape\",\n    \"data\": {\n        \"calculation\": {\n            \"_id\": \"60bd1110c9251f7bfac30677\",\n            \"user\": \"60bcbc2ed1354100151ed795\",\n            \"shape\": \"Triangle\",\n            \"dimensions\": {\n                \"length_a\": 3,\n                \"length_b\": 4,\n                \"length_c\": 4\n            },\n            \"calculation\": \"√5.5 * (5.5 - 3) * (5.5 - 4)  * (5.5 - 4)\",\n            \"formula\": \"√s * (s − length_a) * (s − length_b) * (s − length_c)\",\n            \"area\": 5.56,\n            \"__v\": 0\n        }\n    },\n    \"error\": null\n}"},{"id":"a5ec3072-ac9d-4d18-8939-6b8ba11f4eb7","name":"response:: success - circle","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"shape\": \"Circle\",\n    \"dimensions\": {\n       \"radius\": 4\n    }\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/calculate/"},"status":"Success","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"121"},{"key":"ETag","value":"W/\"79-IsLs6qQl9KH1bm0AIZvwO4+o+as\""},{"key":"Date","value":"Sun, 06 Jun 2021 09:55:48 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": true,\n    \"message\": \"Succesfully calculated area of the shape\",\n    \"data\": {\n        \"calculation\": {\n            \"_id\": \"60bd114bc9251f7bfac30679\",\n            \"user\": \"60bcbc2ed1354100151ed795\",\n            \"shape\": \"Circle\",\n            \"dimensions\": {\n                \"radius\": 4\n            },\n            \"calculation\": \"3.141592653589793 * 16\",\n            \"formula\": \"π * radius²\",\n            \"area\": 157.91,\n            \"__v\": 0\n        }\n    },\n    \"error\": null\n}"},{"id":"87beb99f-a3e0-4c41-af93-5657e6f05d6d","name":"response::: success - square","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"shape\": \"Square\",\n    \"dimensions\": {\n       \"side\": 4\n    }\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/asqaupi/v1/calculate/"},"status":"Success","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"232"},{"key":"ETag","value":"W/\"e8-JGTEM2jHUD8bQ3NOZ+uOAUm0do8\""},{"key":"Date","value":"Sun, 06 Jun 2021 11:55:15 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": true,\n    \"message\": \"Succesfully calculated area of the shape\",\n    \"data\": {\n        \"calculation\": {\n            \"_id\": \"60bce45e0bbebe6c7528171f\",\n            \"user\": \"60bce4240bbebe6c7528171d\",\n            \"shape\": \"Square\",\n            \"dimensions\": {\n                \"side\": 4\n            },\n            \"calculation\": \"4 ** 2\",\n            \"formula\": \"sides ^ 2\",\n            \"area\": 16,\n            \"__v\": 0\n        }\n    },\n    \"error\": null\n}"},{"id":"1459b0d5-de30-4c1e-b5e4-f19d4249ff87","name":"response:: validation error","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"shape\": \"Triangle\",\n    \"dimensions\": {\n        \"length_a\": 3,\n        \"length_b\": \"F\",\n        \"length_c\": 4\n    }\n}","options":{"raw":{"language":"json"}}},"url":"localhost:3000/api/v1/calculate/"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"54"},{"key":"ETag","value":"W/\"36-vdwllaWfb5sJuxsZYuwbLmDV38Q\""},{"key":"Date","value":"Sun, 06 Jun 2021 18:01:55 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": [\n        \"\\\"dimensions.length_b\\\" must be a number\"\n    ]\n}"}],"_postman_id":"72d0ab98-5aa7-452e-bb7a-d3b6f3e9028d"},{"name":"Get previous calculations","id":"a227ad96-3970-4bc9-927f-40f35e8acf7b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://abindev-test.herokuapp.com/api/v1/calculate/all","description":"<p>This endpoint allows logged in user to retrieve their previous calculations.</p>\n<h2 id=\"endpoint\">ENDPOINT:</h2>\n<p>/api/v1/calculate.</p>\n<p>user must be authenticated to access the endpoint.</p>\n<h2 id=\"payloads\">PAYLOADS</h2>\n<p>None</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"4c631d86-ca39-41b8-9ab9-d1b222844862","id":"4c631d86-ca39-41b8-9ab9-d1b222844862","name":"Ab-inbev backend test","type":"collection"}},"urlObject":{"path":["api","v1","calculate","all"],"host":["https://abindev-test.herokuapp.com"],"query":[],"variable":[]}},"response":[{"id":"4c9dc597-97c3-49ca-8700-60399659e4e9","name":"response::: successful","originalRequest":{"method":"GET","header":[],"url":"localhost:3000/api/v1/calculate/all"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"958"},{"key":"ETag","value":"W/\"3be-yrZP4eMU21Ew2bRUMujP4PbO4yU\""},{"key":"Date","value":"Sun, 06 Jun 2021 12:13:39 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": true,\n    \"message\": \"Successfull fetched user's calculations\",\n    \"data\": [\n        {\n            \"calculationId\": \"60bce4400bbebe6c7528171e\",\n            \"user\": {\n                \"userId\": \"60bce4240bbebe6c7528171d\",\n                \"username\": \"phawazzzy\"\n            },\n            \"calculation_details\": {\n                \"shape\": \"Circle\",\n                \"dimensions\": {\n                    \"radius\": 4\n                },\n                \"formula\": \"π * radius²\",\n                \"calculation\": \"3.141592653589793 * 16\",\n                \"area\": 157.91367041742973\n            }\n        },\n        {\n            \"calculationId\": \"60bce45e0bbebe6c7528171f\",\n            \"user\": {\n                \"userId\": \"60bce4240bbebe6c7528171d\",\n                \"username\": \"phawazzzy\"\n            },\n            \"calculation_details\": {\n                \"shape\": \"Square\",\n                \"dimensions\": {\n                    \"side\": 4\n                },\n                \"formula\": \"sides ^ 2\",\n                \"calculation\": \"4 ** 2\",\n                \"area\": 16\n            }\n        },\n        {\n            \"calculationId\": \"60bce47d0bbebe6c75281720\",\n            \"user\": {\n                \"userId\": \"60bce4240bbebe6c7528171d\",\n                \"username\": \"phawazzzy\"\n            },\n            \"calculation_details\": {\n                \"shape\": \"Triangle\",\n                \"dimensions\": {\n                    \"length_a\": 3,\n                    \"length_b\": 4,\n                    \"length_c\": 4\n                },\n                \"formula\": \"√s * (s − length_a) * (s − length_b) * (s − length_c)\",\n                \"calculation\": \"√5.5 * (5.5 - 3) * (5.5 - 4)  * (5.5 - 4)\",\n                \"area\": 5.562148865321747\n            }\n        },\n        {\n            \"calculationId\": \"60bce4a00bbebe6c75281721\",\n            \"user\": {\n                \"userId\": \"60bce4240bbebe6c7528171d\",\n                \"username\": \"phawazzzy\"\n            },\n            \"calculation_details\": {\n                \"shape\": \"Rectangle\",\n                \"dimensions\": {\n                    \"length\": 3,\n                    \"breadth\": 4\n                },\n                \"formula\": \"length * breadth\",\n                \"calculation\": \"3 * 4\",\n                \"area\": 12\n            }\n        }\n    ],\n    \"error\": null\n}"},{"id":"8daf312b-e4d7-45f3-bb52-84b88ffbd819","name":"response:: No calculation","originalRequest":{"method":"GET","header":[],"url":"localhost:3000/api/v1/calculate/all"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"90"},{"key":"ETag","value":"W/\"5a-Kv5BqTPcl5qQtRrr0g4Usk1DdpY\""},{"key":"Date","value":"Sun, 06 Jun 2021 12:16:04 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": true,\n    \"message\": \"This user has not made any calculations\",\n    \"data\": [],\n    \"error\": null\n}"}],"_postman_id":"a227ad96-3970-4bc9-927f-40f35e8acf7b"}],"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]}},"event":[{"listen":"prerequest","script":{"id":"b0c7d945-2c31-452e-8a42-c0f11a8362fc","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"1c58c24c-88d1-4d01-969a-ab73db9c0e27","type":"text/javascript","exec":[""]}}],"variable":[{"key":"LBASE_URL","value":"localhost:3000"},{"key":"BASE_URL","value":"https://abindev-test.herokuapp.com"}]}