{"info":{"_postman_id":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","name":"Flask APIs","description":"<html><head></head><body><p>This collection is for simulating authorisation for <a href=\"https://jsonplaceholder.typicode.com/\">{JSON}Placeholder</a> data. The reason I created this was to simulate a layer of authorisation so I could test stuff like headers, auth guards and refreshing tokens via API response interceptors in the UI.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"3672841","collectionId":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","publishedId":"TzCHCAr2","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-03-25T13:13:53.000Z"},"item":[{"name":"Auth","item":[{"name":"Login","event":[{"listen":"test","script":{"id":"2f71aa1a-c165-41e0-9c3e-40670b753501","exec":["var jsonData = pm.response.json();","pm.collectionVariables.set(\"accessToken\", jsonData[\"access-token\"]);","pm.collectionVariables.set(\"refreshToken\", jsonData[\"refresh-token\"]);"],"type":"text/javascript"}}],"id":"5d5bc40f-ff6d-4bfa-91f5-8a9c88fca635","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//auth/login","description":"<p>Headers Needed:</p>\n<ul>\n<li>Basic Auth (Credentials: admin/admin)</li>\n</ul>\n<p>Returns:</p>\n<ul>\n<li>Access Token (Expires after 15 minutes)</li>\n<li>Refresh Token (Expires after 60 minutes)</li>\n</ul>\n<p><strong>Note</strong>: Note that the test scripts I've written in Postman will automatically store the tokens and inject them in other requests</p>\n","auth":{"type":"basic","basic":{"basicConfig":[{"key":"username","value":"<username>"},{"key":"password","value":"<password>"}]},"isInherited":true,"source":{"_postman_id":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","id":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","name":"Flask APIs","type":"collection"}},"urlObject":{"path":["auth","login"],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"5d5bc40f-ff6d-4bfa-91f5-8a9c88fca635"},{"name":"Refresh","event":[{"listen":"test","script":{"id":"db622658-6f7f-4ec5-bc83-13fb4dc92fe2","exec":["if(pm.response.code === 200) {","    var jsonData = pm.response.json();","    pm.collectionVariables.set(\"accessToken\", jsonData[\"access-token\"]);","    pm.collectionVariables.set(\"refreshToken\", jsonData[\"refresh-token\"]);","    console.log(\"here\")","}"],"type":"text/javascript"}}],"id":"ba18a65c-20ca-44cf-93ba-fe84f5170418","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//auth/refresh","description":"<p>Headers Needed:</p>\n<ul>\n<li>Bearer Token (Refresh Token)</li>\n</ul>\n<p>Returns:</p>\n<ul>\n<li>Access Token (Expires after 15 minutes)</li>\n<li>Refresh Token (Expires after 60 minutes)</li>\n</ul>\n<p><strong>Note</strong>: Note that the test scripts I've written in Postman will automatically store the tokens and inject them in other requests</p>\n","urlObject":{"path":["auth","refresh"],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"ba18a65c-20ca-44cf-93ba-fe84f5170418"}],"id":"a5ab37c9-ca39-426a-a9c9-d8184bf2fb85","description":"<p>This folder consists of Authorisation Requests. This is needed to be run before you run anything else in the collection. The <code>access-token</code> returned from the login request is needed to be passes via the <code>Authentication</code> header (Bearer Token).</p>\n<p>However, for convenience,</p>\n<ul>\n<li>I've automated all of these steps via the test scripts in postman. All you need to do is press the <code>Send</code> button on the login request, and then you can make any other requests until the access token is expired.</li>\n<li>When the access token expires, run the <code>Refresh</code> request (I've automated things here as well, so no need to worry how to replace tokens in the collection variables)</li>\n<li>Tokens are stored in the collection variables</li>\n</ul>\n","_postman_id":"a5ab37c9-ca39-426a-a9c9-d8184bf2fb85","auth":{"type":"basic","basic":{"basicConfig":[{"key":"username","value":"<username>"},{"key":"password","value":"<password>"}]},"isInherited":true,"source":{"_postman_id":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","id":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","name":"Flask APIs","type":"collection"}}},{"name":"Todos","item":[{"name":"All Todos","id":"2c5e56d2-48e3-4695-ab7c-0eeba87614b7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//todos/","urlObject":{"path":["todos",""],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"2c5e56d2-48e3-4695-ab7c-0eeba87614b7"},{"name":"Todo Details","id":"bf6ad0ca-a98f-4447-bc50-02766043d57f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//todos/1","urlObject":{"path":["todos","1"],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"bf6ad0ca-a98f-4447-bc50-02766043d57f"},{"name":"Update Todo","id":"01a9ee0c-6bad-4ed0-841e-585a4aab9a56","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"test\",\n    \"completed\": false\n}","options":{"raw":{"language":"json"}}},"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//todos/2","urlObject":{"path":["todos","2"],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"01a9ee0c-6bad-4ed0-841e-585a4aab9a56"},{"name":"Add Todo","id":"2cc16677-fd32-4fc6-a5bd-ac83a34c7382","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"ipsa repellendus fugit nisi\",\n    \"completed\": false\n}","options":{"raw":{"language":"json"}}},"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//todos/","urlObject":{"path":["todos",""],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"2cc16677-fd32-4fc6-a5bd-ac83a34c7382"},{"name":"Delete Todo","id":"40160b80-4093-431c-80a2-df8dba6b5f2a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//todos/2","urlObject":{"path":["todos","2"],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"40160b80-4093-431c-80a2-df8dba6b5f2a"}],"id":"2f51bca8-62da-4ac6-97b2-9bf603628a81","description":"<p>Data Sourced from <a href=\"https://jsonplaceholder.typicode.com/todos\">{JSON}Placeholder/todos</a></p>\n","_postman_id":"2f51bca8-62da-4ac6-97b2-9bf603628a81","auth":{"type":"basic","basic":{"basicConfig":[{"key":"username","value":"<username>"},{"key":"password","value":"<password>"}]},"isInherited":true,"source":{"_postman_id":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","id":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","name":"Flask APIs","type":"collection"}}},{"name":"Posts","item":[{"name":"All Posts","id":"36afdce0-6280-4aba-8130-48426510e1cf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//posts/","urlObject":{"path":["posts",""],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"36afdce0-6280-4aba-8130-48426510e1cf"},{"name":"Post Details","id":"1ad139be-e7da-4f8e-b175-39cc4fc115e3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//posts/1","urlObject":{"path":["posts","1"],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"1ad139be-e7da-4f8e-b175-39cc4fc115e3"},{"name":"Update Post","id":"c8d237b3-5658-4c6f-9ff9-c5d361160c23","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"Vue.js is fun!\",\n    \"body\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\"\n}","options":{"raw":{"language":"json"}}},"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//posts/101","urlObject":{"path":["posts","101"],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"c8d237b3-5658-4c6f-9ff9-c5d361160c23"},{"name":"Add Post","id":"0b0d7063-4997-4a60-90b2-49c58584bf6b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"Vue.js is fun!\",\n    \"body\": \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.\"\n}","options":{"raw":{"language":"json"}}},"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//posts/","urlObject":{"path":["posts",""],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"0b0d7063-4997-4a60-90b2-49c58584bf6b"},{"name":"Delete Post","id":"880fd084-22e9-49ea-9342-38169f271549","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//posts/101","urlObject":{"path":["posts","101"],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"880fd084-22e9-49ea-9342-38169f271549"}],"id":"01483699-d029-4cfe-986e-ef04ca15b024","description":"<p>Data Sourced from <a href=\"https://jsonplaceholder.typicode.com/posts\">{JSON}Placeholder/posts</a></p>\n","_postman_id":"01483699-d029-4cfe-986e-ef04ca15b024","auth":{"type":"basic","basic":{"basicConfig":[{"key":"username","value":"<username>"},{"key":"password","value":"<password>"}]},"isInherited":true,"source":{"_postman_id":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","id":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","name":"Flask APIs","type":"collection"}}},{"name":"Status","id":"512c0653-6145-4cd3-a61d-68201cb391c0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://bacon-delight-demo-flask-apis.herokuapp.com//status","auth":{"type":"basic","basic":{"basicConfig":[{"key":"username","value":"<username>"},{"key":"password","value":"<password>"}]},"isInherited":true,"source":{"_postman_id":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","id":"a6087d73-30f2-4d95-b88c-11bf2f47d9a6","name":"Flask APIs","type":"collection"}},"urlObject":{"path":["status"],"host":["https://bacon-delight-demo-flask-apis.herokuapp.com/"],"query":[],"variable":[]}},"response":[],"_postman_id":"512c0653-6145-4cd3-a61d-68201cb391c0"}],"auth":{"type":"basic","basic":{"basicConfig":[{"key":"username","value":"<username>"},{"key":"password","value":"<password>"}]}},"event":[{"listen":"prerequest","script":{"id":"52709ffb-19c7-4324-b039-5d5b89420d92","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"a3a0c1fb-db34-4159-a9f3-ff3c235b96f9","type":"text/javascript","exec":[""]}}],"variable":[{"key":"baseURL","value":"https://bacon-delight-demo-flask-apis.herokuapp.com/"},{"key":"accessToken","value":""},{"key":"refreshToken","value":""}]}