{"info":{"_postman_id":"e8e57f0e-a304-4a67-a678-b73489d4d50b","name":"API 101","description":"<html><head></head><body><p>API 101 template for learning API request basics. Follow along with the webinar / video or just open the first request and hit <strong>Send</strong>!</p>\n<p>For the newer version of this learning leading to certification see the <a href=\"https://bit.ly/postman-training\">Postman Training Workspace</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"1841124","collectionId":"e8e57f0e-a304-4a67-a678-b73489d4d50b","publishedId":"T1DwdZmy","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-08-04T13:44:54.000Z"},"item":[{"name":"Get all customers","event":[{"listen":"prerequest","script":{"id":"21de9b2f-9c6b-4fbb-9b39-480ab29c7592","exec":[""],"type":"text/javascript"}}],"id":"3165ca0e-0358-41cd-8b89-bad36b0b5693","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"user-id","value":"","type":"text"}],"url":"https://api-101.glitch.me/customers","urlObject":{"protocol":"https","path":["customers"],"host":["api-101","glitch","me"],"query":[],"variable":[]}},"response":[],"_postman_id":"3165ca0e-0358-41cd-8b89-bad36b0b5693"},{"name":"Get one customer","id":"e81f2c67-9f62-4713-a5c3-44aa898ae5a0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"user-id","value":"","type":"text"}],"url":"api-101.glitch.me/customer","urlObject":{"path":["customer"],"host":["api-101.glitch.me"],"query":[],"variable":[]}},"response":[],"_postman_id":"e81f2c67-9f62-4713-a5c3-44aa898ae5a0"},{"name":"Add new customer","id":"4c7f4681-54e8-4281-a5ff-e26316fc8c6f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"user-id","value":"","type":"text"}],"url":"api-101.glitch.me/customer","urlObject":{"path":["customer"],"host":["api-101.glitch.me"],"query":[],"variable":[]}},"response":[],"_postman_id":"4c7f4681-54e8-4281-a5ff-e26316fc8c6f"},{"name":"Update customer","id":"1387b28f-dc15-4a33-9a0f-9bc8b8aa60df","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"user-id","value":"","type":"text"}],"url":"api-101.glitch.me/customer/:customer_id","urlObject":{"path":["customer",":customer_id"],"host":["api-101.glitch.me"],"query":[],"variable":[{"type":"string","value":"placeholder","key":"customer_id"}]}},"response":[],"_postman_id":"1387b28f-dc15-4a33-9a0f-9bc8b8aa60df"},{"name":"Remove customer","event":[{"listen":"prerequest","script":{"id":"95974978-cd2e-4703-b621-00175639c15d","exec":[""],"type":"text/javascript"}}],"id":"65fbdac0-a0a1-432f-b427-63b95556a497","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"user-id","value":"","type":"text"}],"url":"api-101.glitch.me/customer/:customer_id","urlObject":{"path":["customer",":customer_id"],"host":["api-101.glitch.me"],"query":[],"variable":[{"type":"string","value":"placeholder","key":"customer_id"}]}},"response":[],"_postman_id":"65fbdac0-a0a1-432f-b427-63b95556a497"}],"event":[{"listen":"prerequest","script":{"id":"c05d9cd2-a186-4b2a-af7d-7d11ec3df993","type":"text/javascript","exec":["var uID = pm.collectionVariables.get(\"userId\");","if(!uID)","    pm.collectionVariables.set(\"userId\", pm.variables.replaceIn('22f8e3bb-58fd-4252-9eeb-417c6d21797f'));"]}},{"listen":"test","script":{"id":"8041cac9-adc2-4e16-b7dd-efa209d3c81e","type":"text/javascript","exec":["var template = `","    <!--showdown for converting md to html-->","    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js\"></script>","    <script type=\"text/javascript\">","        function getContent(orig){","            var converter = new showdown.Converter(), text = orig, html = converter.makeHtml(text);","            return html;","        }","    </script>","    ","    <!--syntax highlighting-->","    <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/styles/default.min.css\">","    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/highlight.min.js\"></script>","    <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.0/styles/googlecode.min.css\">","    ","    <!--generic styles-->","    <style type=\"text/css\">","    #notes p, #next p {padding-left:20px; border-left:2px solid #333333; }","    #notes, #next {padding-right:20px;}","    img {max-width:600px; padding-left:20px; padding-bottom:20px;}","    </style>","","    <h2>{{response.tutorial.title}}</h2>","    ","    <div id=\"intro\"></div>","","    <div id=\"notes\"></div>","    ","    {{#if response.tutorial.next}}","    <h3>Next</h3>","    <div id=\"next\"></div>","    {{/if}}","    ","    <script type=\"text/javascript\">","        if(\"{{response.tutorial.rip}}\".length>0)","            document.write(getContent(\"{{response.tutorial.rip}}\"));","    </script>","    ","    <script type=\"text/javascript\">","        if(\"{{response.tutorial.pic}}\".length>0)","            document.write(\"<img src='{{response.tutorial.pic}}' alt='postman steps'/>\");","    </script>","","    <!--content to process before rendering-->","    <script type=\"text/javascript\">","        pm.getData(function(error, data) {","            let json_strings = []; let i; let info_array = data.response.tutorial.steps;","            var notes=\"<div id='notes'>\";","            for(i=0; i<info_array.length; i++){","                notes+=getContent(info_array[i].note);","                if(info_array[i].raw_data){","                    notes+=\"<pre style='padding-left:20px'><code class='json'>\"+JSON.stringify(info_array[i].raw_data, null, 2)+\"</code></pre>\";","                }","                if(info_array[i].pic)","                    notes+=\"<img src='\"+info_array[i].pic+\"' alt='postman steps'/>\";","            }","            notes+=\"</div>\"","            document.getElementById(\"intro\").innerHTML=getContent(data.response.tutorial.intro);","            document.getElementById(\"notes\").innerHTML=notes;","            var nextDiv=document.getElementById(\"next\");","            var n;","            var nextContent=\"\";","            let nextArray=data.response.tutorial.next;","            for(n=0; n<nextArray.length; n++){","                nextContent+=\"<p>\"+getContent(nextArray[n].step)+\"</p>\";","             if(nextArray[n].raw_data){","                 nextContent+=\"<pre style='padding-left:20px'><code class='json'>\"+JSON.    stringify(nextArray[n].raw_data, null, 2)+\"</code></pre>\";","                }","            }","            nextDiv.innerHTML=getContent(nextContent);","            hljs.initHighlighting();","        });","    </script>","`;","if (pm.response.headers.get(\"Content-Type\").includes(\"json\")) {","    pm.visualizer.set(template, {","        response: pm.response.json()","    });","}","else if (pm.response.headers.get(\"Content-Type\").includes(\"html\")) {","    pm.visualizer.set(`{{info}}`, { info: \"Hmm this seems to be HTML and not JSON - you might have hit an invalid endpoint - undo your changes, or close the request without saving and try opening / sending it again!\" });","}"]}}],"variable":[{"key":"apiUrl","value":"api-101.glitch.me"},{"key":"userId","value":""}]}