{"info":{"_postman_id":"ba10121f-2bb6-471b-a2c7-875c60067a41","name":"Full Stack Cafe","description":"<html><head></head><body><p>This is a coffee shop app with a flask-based API and an Auth0 authorization and authentication backend. Full Stack Cafe uses role based access control to limit the actions of users. Users with the barista role can view the recipes for various drinks and users with the manager role can create, edit, or delete drinks. This app also utilizes an ionic front end. You will need python3, nodejs, and ionic installed to run the app.</p>\n<h1 id=\"base-url\">Base URL</h1>\n<p>When running locally with the built in flask server, the base URL is as follows:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">http://127.0.0.1:5000/\n</code></pre>\n<h1 id=\"authentication\">Authentication</h1>\n<p>Authentication is done through including a JWT Bearer Token in the authorization header.</p>\n<h1 id=\"error-codes\">Error Codes</h1>\n<p>Below are a list of errors that may be raised as part of the API</p>\n<h2 id=\"400-bad-request\">400: Bad Request</h2>\n<p>This is returned when the request is malformed in some way. (i.e. Required info is missing)</p>\n<h2 id=\"401-unauthorized\">401: Unauthorized</h2>\n<p>This is returned when accessing a non-public endpoint while unauthenticated. (i.e. User is not logged in)</p>\n<h3 id=\"authorization_header_missing\">authorization_header_missing</h3>\n<p>This is the error when there is no header for authorization included with the request.</p>\n<h3 id=\"invalid_header\">invalid_header</h3>\n<p>This is the error when the authorization header is malformed in some way. (i.e. The token is in the incorrect format)</p>\n<h3 id=\"token_expired\">token_expired</h3>\n<p>This is the error when the provided token is expired and the user must re-login</p>\n<h3 id=\"invalid_claims\">invalid_claims</h3>\n<p>This is error if the token is invalid in any other way. (i.e. The token has been modified or the permissions object is missing)</p>\n<h2 id=\"403-forbidden\">403: Forbidden</h2>\n<p>This is returned when accessing a resource you are not authorized to access. (i.e. User is logged in but does not have sufficient permissions to access the requested resource)</p>\n<h2 id=\"404-not-found\">404: Not Found</h2>\n<p>This is returned when the requested resource does not exist.</p>\n<h2 id=\"405-method-not-allowed\">405: Method Not Allowed</h2>\n<p>This is returned when the incorrect request method is specified at an endpoint. (i.e. Attempting to delete without specifying a specific drink to delete)</p>\n<h2 id=\"422-unprocessable-entity\">422: Unprocessable Entity</h2>\n<p>This is returned when the request is unable to be fulfilled in some way. (i.e. Attempting to update a drink that has previously been deleted)</p>\n<h2 id=\"500-internal-server-error\">500: Internal Server Error</h2>\n<p>This is returned when something there is a problem with the server.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Base URL","slug":"base-url"},{"content":"Authentication","slug":"authentication"},{"content":"Error Codes","slug":"error-codes"}],"owner":"10868159","collectionId":"ba10121f-2bb6-471b-a2c7-875c60067a41","publishedId":"SzfDxQzs","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"3880FF"},"publishDate":"2020-04-28T23:59:45.000Z"},"item":[{"name":"Drinks","id":"22b58b2e-3901-43ed-b4ec-288a97dc2496","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"/drinks","description":"<p>Retrieve a list of drinks</p>\n","urlObject":{"path":["drinks"],"query":[],"variable":[]}},"response":[{"id":"b4b1a5b6-e228-4b39-9639-aa8f7ceeeda5","name":"Successful Request","originalRequest":{"method":"GET","header":[],"url":"/drinks"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"drinks\": [\n        {\n            \"id\": 1,\n            \"title\": \"Mocha\",\n            \"recipe\": [\n                {\n                    \"parts\": 1,\n                    \"color\": \"#e8ddb8\"\n                },\n                {\n                    \"parts\": 2,\n                    \"color\": \"#743315\"\n                },\n                {\n                    \"parts\": 1,\n                    \"color\": \"#371808\"\n                }\n            ]\n        }\n    ]\n}"}],"_postman_id":"22b58b2e-3901-43ed-b4ec-288a97dc2496"},{"name":"Drinks Detail","id":"4aad9a90-5d74-4122-9219-4f4708de34c6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{token}}","type":"text"}],"url":"/drinks-detail","description":"<p>Retrieve a list of drinks with recipe details included</p>\n<p>Required Permissions: <code>get:drinks-detail</code></p>\n<p>Parameters:</p>\n<ul>\n<li>token (str): A JWT Bearer token in Authorization header</li>\n</ul>\n","urlObject":{"path":["drinks-detail"],"query":[],"variable":[]}},"response":[{"id":"0019510c-2635-4d6f-a2d2-f1a6ca1c5eb6","name":"Authorization Header Missing","originalRequest":{"method":"GET","header":[],"url":"/drinks-detail"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error_code\": \"authorization_header_missing\",\n    \"description\": \"Authorization header is expected\"\n}"},{"id":"26658654-f802-49e6-9f7b-669d4536ead5","name":"Successful Request","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{token}}","type":"text"}],"url":"/drinks-detail"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"drinks\": [\n        {\n            \"id\": 1,\n            \"title\": \"Mocha\",\n            \"recipe\": [\n                {\n                    \"name\": \"Milk\",\n                    \"parts\": 1,\n                    \"color\": \"#e8ddb8\"\n                },\n                {\n                    \"name\": \"Chocolate\",\n                    \"parts\": 2,\n                    \"color\": \"#743315\"\n                },\n                {\n                    \"name\": \"Espresso\",\n                    \"parts\": 1,\n                    \"color\": \"#371808\"\n                }\n            ]\n        }\n    ]\n}"}],"_postman_id":"4aad9a90-5d74-4122-9219-4f4708de34c6"},{"name":"Create Drink","id":"874db708-6be5-4c61-ac8f-65bac18a126f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer {{token}}"},{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"title\": {{title}},\n    \"recipe\": [\n        {\n            \"name\": {{name}},\n            \"parts\": {{parts}},\n            \"color\": {{color}}\n        }\n    ]\n}"},"url":"/drinks","description":"<p>Create a new drink</p>\n<p>Required Permissions: <code>post:drinks</code></p>\n<p>Parameters:</p>\n<ul>\n<li>token (str): A JWT Bearer token in Authorization header</li>\n<li>title (str): Title of the drink</li>\n<li>recipe (list): A list of ingredient objects<ul>\n<li>name (str): Name of the ingredient in the recipe</li>\n<li>parts (int): Number of parts of the recipe the ingredient comprises</li>\n<li>color (int): Color of the ingredient</li>\n</ul>\n</li>\n</ul>\n","urlObject":{"path":["drinks"],"query":[],"variable":[]}},"response":[{"id":"a9d96b2c-37ae-4ff0-8bd5-53c9136a456e","name":"Forbidden","originalRequest":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer {{token}}"},{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"title\": \"Water\",\n    \"recipe\": [\n        {\n            \"name\": \"Water\",\n            \"parts\": \"1\",\n            \"color\": \"blue\"\n        }\n    ]\n}"},"url":"/drinks"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error_code\": \"forbidden\",\n    \"description\": \"You are not authorized to access this resource\"\n}"},{"id":"c7abca39-eadf-4a6f-ba86-eb69d596429c","name":"Successful Request","originalRequest":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer {{token}}"},{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"title\": \"Water\",\n    \"recipe\": [\n        {\n            \"name\": \"Water\",\n            \"parts\": \"1\",\n            \"color\": \"blue\"\n        }\n    ]\n}"},"url":"/drinks"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"created_drink_id\": 2,\n    \"old_drink\": null,\n    \"new_drink\": {\n        \"id\": 2,\n        \"title\": \"Water\",\n        \"recipe\": [\n            {\n                \"name\": \"Water\",\n                \"parts\": 1,\n                \"color\": \"blue\"\n            }\n        ]\n    }\n}"},{"id":"d3845ba6-cc66-4a0a-b34b-f5bc3340a4f8","name":"Bad Request","originalRequest":{"method":"POST","header":[{"key":"Authorization","type":"text","value":"Bearer {{token}}"},{"key":"Content-Type","type":"text","value":"application/json"}],"url":"/drinks"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error_code\": \"bad_request\",\n    \"description\": \"The request was malformed in some way\"\n}"}],"_postman_id":"874db708-6be5-4c61-ac8f-65bac18a126f"},{"name":"Update Drink","id":"2ce2791e-ee42-47be-af9b-6a390035d3ab","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Authorization","type":"text","value":"Bearer {{token}}"},{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"title\": {{title}},\n    \"recipe\": [\n        {\n            \"name\": {{name}},\n            \"parts\": {{parts}},\n            \"color\": {{color}}\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"/drinks/{{drink_id}}","description":"<p>Update an existing drink</p>\n<p>Required Permissions: <code>patch:drinks</code></p>\n<p>Parameters:</p>\n<ul>\n<li>drink_id (int): The id of the drink to be updated</li>\n<li>token (str): A JWT Bearer token in Authorization header</li>\n<li>title (str) [optional]: Title of the drink</li>\n<li>recipe (list) [optional]: A list of ingredient objects<ul>\n<li>name (str): Name of the ingredient in the recipe</li>\n<li>parts (int): Number of parts of the recipe the ingredient comprises</li>\n<li>color (int): Color of the ingredient</li>\n</ul>\n</li>\n</ul>\n","urlObject":{"path":["drinks","{{drink_id}}"],"query":[],"variable":[]}},"response":[{"id":"518173fd-e721-4c03-9842-9be0bed7613c","name":"Bad Request","originalRequest":{"method":"PATCH","header":[{"key":"Authorization","type":"text","value":"Bearer {{token}}"},{"key":"Content-Type","type":"text","value":"application/json"}],"url":"/drinks/2"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error_code\": \"bad_request\",\n    \"description\": \"The request was malformed in some way\"\n}"},{"id":"7190ae23-1d31-44b9-8aee-9d5e0db590bf","name":"Forbidden","originalRequest":{"method":"PATCH","header":[{"key":"Authorization","type":"text","value":"Bearer {{token}}"},{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"title\": \"Whiskey\",\n    \"recipe\": [\n        {\n            \"name\": \"Whiskey\",\n            \"parts\": \"1\",\n            \"color\": \"brown\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"/drinks/2"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error_code\": \"forbidden\",\n    \"description\": \"You are not authorized to access this resource\"\n}"},{"id":"7a8f119c-5e47-41ee-afa4-488f8f228271","name":"Unprocessable Entity","originalRequest":{"method":"PATCH","header":[{"key":"Authorization","type":"text","value":"Bearer {{token}}"},{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"title\": \"Whiskey\",\n    \"recipe\": [\n        {\n            \"name\": \"Whiskey\",\n            \"parts\": \"1\",\n            \"color\": \"brown\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"/drinks/7"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error_code\": \"unprocessable_entity\",\n    \"description\": \"The request was unable to be fulfilled\"\n}"},{"id":"aabdefcd-6f69-43ad-9e99-ebd1189b16ab","name":"Successful Request","originalRequest":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer {{token}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"title\": \"Whiskey\",\n    \"recipe\": [\n        {\n            \"name\": \"Whiskey\",\n            \"parts\": \"1\",\n            \"color\": \"brown\"\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"/drinks/2"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"updated_drink_id\": 2,\n    \"new_drink\": {\n        \"id\": 6,\n        \"title\": \"Whiskey\",\n        \"recipe\": [\n            {\n                \"name\": \"Whiskey\",\n                \"parts\": 1,\n                \"color\": \"brown\"\n            }\n        ]\n    },\n    \"old_drink\": {\n        \"id\": 6,\n        \"title\": \"Water\",\n        \"recipe\": [\n            {\n                \"name\": \"Water\",\n                \"parts\": 1,\n                \"color\": \"blue\"\n            }\n        ]\n    }\n}"}],"_postman_id":"2ce2791e-ee42-47be-af9b-6a390035d3ab"},{"name":"Delete Drink","id":"408086db-46e8-4934-ba6f-49b57c4e0a52","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{token}}","type":"text"}],"url":"/drinks/1","description":"<p>Delete an existing drink</p>\n<p>Required Permissions: <code>delete:drinks</code></p>\n<p>Parameters:</p>\n<ul>\n<li>drink_id (int): The id of the drink to be deleted</li>\n<li>token (str): A JWT Bearer token in Authorization header</li>\n</ul>\n","urlObject":{"path":["drinks","1"],"query":[],"variable":[]}},"response":[{"id":"17493d11-60aa-47aa-98b4-ffed4d98b326","name":"Unprocessable Entity","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{token}}","type":"text"}],"url":"/drinks/7"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error_code\": \"unprocessable_entity\",\n    \"description\": \"The request was unable to be fulfilled\"\n}"},{"id":"969f4c47-7f5a-458b-9d24-f74386a32409","name":"Successful Request","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{token}}","type":"text"}],"url":"/drinks/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"deleted_drink_id\": 1,\n    \"old_drink\": {\n        \"id\": 1,\n        \"title\": \"Mocha\",\n        \"recipe\": [\n            {\n                \"name\": \"Milk\",\n                \"parts\": 1,\n                \"color\": \"#e8ddb8\"\n            },\n            {\n                \"name\": \"Chocolate\",\n                \"parts\": 2,\n                \"color\": \"#743315\"\n            },\n            {\n                \"name\": \"Espresso\",\n                \"parts\": 1,\n                \"color\": \"#371808\"\n            }\n        ]\n    },\n    \"new_drink\": null\n}"},{"id":"e89703dd-f612-4617-9667-33aa3cdc28a7","name":"Forbidden","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{token}}","type":"text"}],"url":"/drinks/1"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error_code\": \"forbidden\",\n    \"description\": \"You are not authorized to access this resource\"\n}"}],"_postman_id":"408086db-46e8-4934-ba6f-49b57c4e0a52"}]}