├── README.md ├── course-notes.md └── motion ├── ebook-api.md ├── form-example.html ├── helloworld.md ├── list-files.py ├── media-player-api.md └── uppercase.md /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # 👋 Introduction to APIs 4 | 5 | Hello and welcome to this free course on Application Programming Interfaces, or APIs. 6 | 7 | ⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️ 8 | 9 | This course has been deprecated! That means that you should no longer use it, you should head to the newer 2023 version! 10 | 11 | [![Watch the video on freeCodeCamp](https://img.youtube.com/vi/WXsD0ZgxjRw/maxresdefault.jpg)](https://youtu.be/WXsD0ZgxjRw) 12 | 13 | [2023 notes](https://twil.io/notes-api-course) 14 | 15 | ⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️ 16 | 17 | 18 | ## Important links 19 | 20 | * [Course notes](./course-notes.md) 21 | * [Glitch starter repo for Complimentr in Python](https://github.com/craigsdennis/intro-to-apis-flask) 22 | * [Glitch starter repo for Complimentr in JavaScript](https://github.com/craigsdennis/intro-to-apis-node) 23 | * [Learn more for free using a video game 🎮](https://twilio.com/quest?utm_source=gh-link&utm_medium=referral&utm_campaign=intro-to-apis) 24 | 25 | [@craigsdennis](https://twitter.com/craigsdennis) -------------------------------------------------------------------------------- /course-notes.md: -------------------------------------------------------------------------------- 1 | # Introduction to APIs 2019 2 | 3 | ## THERE IS A NEWER VERSION FOR 2023!!!! 4 | 5 | ⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️ 6 | 7 | This course has been deprecated! That means that you should no longer use it, you should head to the newer 2023 version! 8 | 9 | [![Watch the video on freeCodeCamp](https://img.youtube.com/vi/WXsD0ZgxjRw/maxresdefault.jpg)](https://youtu.be/WXsD0ZgxjRw) 10 | 11 | [2023 notes](https://twil.io/notes-api-course) 12 | 13 | ⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️⛔️ 14 | 15 | ## Unit 1 - What is an API 16 | 17 | In this unit we'll define what an API, or Application Programming Interface is and why you should use them. 18 | 19 | ### Video 1 - Welcome 20 | 21 | 👋 Hello and welcome to the course and your notes! Make sure you check this area out often! 22 | 23 | #### 👀 - Beginner content 24 | 25 | * [freeCodeCamp.org](https://www.freecodecamp.org/) is a great place to get started and I recommend jumping [right in](https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/say-hello-to-html-elements). 26 | * [freeCodeCamp on YouTube](https://www.youtube.com/freecodecamp) provides a wonderful collection of beginning programming courses. I recommend the [🎥 JavaScript](https://www.youtube.com/watch?v=PkZNo7MFNFg) and [🎥 Python](https://www.youtube.com/watch?v=rfscVS0vtbw) tutorials. 27 | 28 | #### 📚 - Designing API Content 29 | 30 | * [ProgrammableWeb 101 - What exactly is an API](https://www.youtube.com/watch?v=cpRcK4GS068&list=PLcgRuP1JhcBP8Kh0MC53GH_pxqfOhTVLa) 31 | * [moseif - API Guide](https://www.moesif.com/blog/api-guide/) 32 | 33 | ### Video 2 - Defining Interface 34 | 35 | #### 📚 - Learn more 36 | 37 | ##### Media Player APIs 38 | 39 | Don't worry about understanding it, just appreciate their complexity 40 | 41 | * [Android MediaPlayer API documentation](https://developer.android.com/reference/android/media/MediaPlayer) 42 | * [iOS Media Player API documentation](https://developer.apple.com/documentation/mediaplayer) 43 | * [Web Audio API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API) 44 | 45 | ### Video 3 - Defining API 46 | 47 | #### 📚 - Learn more 48 | 49 | * [mdn - Web APIs](https://developer.mozilla.org/en-US/docs/Web/API) 50 | * [Google vs. Oracle on the rights to the Java API](https://www.theverge.com/2019/11/15/20946398/oracle-google-java-copyright-lawsuit-trial-supreme-court-request) 51 | 52 | ### Video 4 - Remote APIs 53 | 54 | * [Wikipedia - SOAP](https://en.wikipedia.org/wiki/SOAP) 55 | * [Wikipedia - Remote Procedure Call (RPC)](https://en.wikipedia.org/wiki/Remote_procedure_call) 56 | * [SOAP and REST at Odds](https://thehistoryoftheweb.com/soap-rest-odds/) 57 | * [SOAP vs. REST](https://stackify.com/soap-vs-rest/) 58 | * [REST vs. RPC](https://cloud.google.com/blog/products/application-development/rest-vs-rpc-what-problems-are-you-trying-to-solve-with-your-apis) 59 | 60 | ### Video 5 - How the web works 61 | 62 | * [Wikipedia - HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) 63 | * [mdn - How the web works](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/How_the_Web_works) 64 | * [Space Jam Website](http://www.spacejam.com) 65 | 66 | ### Video 6 - RESTful API Constraint Scavenger Hunt 67 | 68 | * [Wikipedia - Representational State Transfer](https://en.wikipedia.org/wiki/Representational_state_transfer) 69 | 70 | ## Unit 2 - Exploring APIs 71 | 72 | ### Video 1 - Exploring an API online 73 | 74 | * [Spotify for Developers](https://developer.spotify.com/) 75 | * [Spotify - Search API {BETA}](https://developer.spotify.com/documentation/web-api/reference-beta/#category-search) 76 | * [Lizzo's Spotify Page](https://open.spotify.com/artist/56oDRnqbIiwx4mymNEv7dS) 77 | * Lizzo's Spotify ID: `56oDRnqbIiwx4mymNEv7dS` 78 | 79 | #### 👀 - Explore 80 | 81 | ProgrammableWeb provides [a categorized directory of APIs](https://www.programmableweb.com/category-api). API List provides [categories and a powerful search feature](https://apilist.fun/). 82 | 83 | ### Video 2 - Using an API from the command line 84 | 85 | * [Twilio](https://www.twilio.com/referral/d4X15O) 86 | * [Twilio Console](https://twilio.com/console?utm_source=gh-link&utm_medium=referral&utm_campaign=intro-to-apis) 87 | * [SMS Getting Started](https://www.twilio.com/console/sms/getting-started/build?utm_source=gh-link&utm_medium=referral&utm_campaign=intro-to-apis) 88 | * Check out the [jq tutorial](https://stedolan.github.io/jq/tutorial/) for parsing JSON on the command line 89 | 90 | #### cURL 91 | 92 | ##### Mac OS 93 | 94 | ###### Using Homebrew 95 | 96 | ```bash 97 | brew install curl 98 | ``` 99 | 100 | ###### Download 101 | 102 | [⬇️ - Download cURL for MacOSX](https://curl.haxx.se/dlwiz/?type=bin&os=Mac+OS+X) 103 | 104 | ##### Windows 105 | 106 | [⬇️ - Download cURL for Windows](https://curl.haxx.se/windows/) 107 | 108 | NOTE: If you are running PowerShell, delete the `curl` alias for `Invoke-WebRequest` by adding the following command to your profile (`C:\Users\\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1)`: 109 | 110 | ```bash 111 | Remove-Item alias:curl 112 | ``` 113 | 114 | #### 📚 - Learn More 115 | 116 | * [cURL manpage](https://curl.haxx.se/docs/manpage.html) 117 | * [Wikipedia - POST (HTTP)](https://en.wikipedia.org/wiki/POST_(HTTP)) (For info on `form-urlencoded` search for "Use for submitting web forms) 118 | 119 | ### Video 3 - Using Postman to explore APIs 120 | 121 | ⬇️ - Download [Postman](https://postman.com/downloads) 122 | 123 | The Twilio Messages API URL is: 124 | 125 | ```bash 126 | https://api.twilio.com/2010-04-01/Accounts//Messages.json 127 | ``` 128 | 129 | Make sure to replace that `SID` with your Account SID which can be found in the [Twilio console](https://twilio.com/console) 130 | 131 | ### Video 4 - Please please Mr. Postman 132 | 133 | ⬇️ - Many wonderful API Collections can be downloaded for exploration in the [Postman API Network](https://explore.postman.com/) 134 | 135 | #### 📚 - Learn more 136 | 137 | * [How Collaboration Works in Postman](https://www.getpostman.com/how-api-collaboration-works) 138 | * [Official Postman Tutorials](https://www.getpostman.com/resources/videos-tutorials/) 139 | 140 | ### Video 5 - Using Helper Libraries (JavaScript) 141 | 142 | * [Install Node.js](https://nodejs.org/en/download/) 143 | * [Install Python 3](https://www.python.org/downloads/) 144 | * [Install Visual Studio Code](https://code.visualstudio.com/download) 145 | * [macOS](https://code.visualstudio.com/docs/setup/mac) 146 | * [Windows](https://code.visualstudio.com/docs/setup/windows) 147 | * [Linux](https://code.visualstudio.com/docs/setup/linux) 148 | 149 | To use the [Twilio Node Helper Library](https://www.twilio.com/docs/libraries/node#installation) 150 | 151 | ```bash 152 | npm install twilio 153 | ``` 154 | 155 | #### 📚 - Learn More 156 | 157 | * [Wikipedia - Boilerplate code](https://en.wikipedia.org/wiki/Boilerplate_code) 158 | 159 | ### Video 6 - Using Helper Libraries (Python) 160 | 161 | * [Install Python 3](https://www.python.org/downloads/) 162 | 163 | To use the [Twilio Python Helper Library](https://www.twilio.com/docs/libraries/python) 164 | 165 | ```bash 166 | pip install twilio 167 | ``` 168 | 169 | ## Unit 3 - Using APIs 170 | 171 | ### Video 1 - Introducing the project 172 | 173 | * [Glitch](https://glitch.com) 174 | 175 | #### 📚 - Learn more 176 | 177 | * [Slack API](https://api.slack.com/) 178 | * [Sportsball APIs](https://rapidapi.com/blog/best-sports-apis-ranked/) 179 | * [Philips Hue API](https://developers.meethue.com/) 180 | * [🎥 Furby Hacking 101 w/ Chloe Condon](https://www.youtube.com/watch?v=dWpqoMObX54) 181 | 182 | ### Video 2 - Flask app 183 | 184 | ⚠️ Several students have reported that cloning sets up a default Glitch application. If this happens to you, in the Glitch app that is created choose "Tools >> Extras >> Git Import and Export >> Import from GitHub" when prompted enter "craigsdennis/intro-to-apis-node" or "craigsdennis/intro-to-apis-flask" 185 | 186 | [Complimentr Flask GitHub repository](https://github.com/craigsdennis/intro-to-apis-flask) is located at `https://github.com/craigsdennis/intro-to-apis-flask.git` 187 | 188 | * [Twilio docs - Create a Message with Python](https://www.twilio.com/docs/sms/api/message-resource?code-sample=code-create-a-message&code-language=Python&utm_source=gh-link&utm_medium=referral&utm_campaign=intro-to-apis) 189 | * [Twilio docs - List all Messages with Python](https://www.twilio.com/docs/sms/api/message-resource?utm_source=gh-link&utm_medium=referral&utm_campaign=intro-to-apis&code-sample=code-read-list-all-messages&code-language=Python) 190 | 191 | #### 📚 - Learn more 192 | 193 | * [Flask documentation](https://flask.palletsprojects.com/) 194 | * [Environment Variables](https://www.twilio.com/docs/usage/secure-credentials) 195 | 196 | ### Video 3 - Dealing with API Limits 197 | 198 | #### 📚 - Learn more 199 | 200 | * [Nordic APIs - Everything You Need To Know About API Rate Limiting](https://nordicapis.com/everything-you-need-to-know-about-api-rate-limiting/) 201 | 202 | ### Video 4 - JavaScript Single Page Application 203 | 204 | ⚠️ Several students have reported that cloning sets up a default Glitch application. If this happens to you, in the Glitch app that is created choose "Tools >> Extras >> Git Import and Export >> Import from GitHub" when prompted enter "craigsdennis/intro-to-apis-node" or "craigsdennis/intro-to-apis-flask" 205 | 206 | [Complimentr Node.js GitHub repository](https://github.com/craigsdennis/intro-to-apis-node) is located at `https://github.com/craigsdennis/intro-to-apis-node.git` 207 | 208 | * [Twilio docs - Create a Message with Node.js](https://www.twilio.com/docs/sms/api/message-resource?code-sample=code-create-a-message&code-language=Node.js&utm_source=gh-link&utm_medium=referral&utm_campaign=intro-to-apis) 209 | * [Twilio docs - List all Messages with Node.js](https://www.twilio.com/docs/sms/api/message-resource?utm_source=gh-link&utm_medium=referral&utm_campaign=intro-to-apis&code-sample=code-read-list-all-messages&code-language=Node.js) 210 | 211 | #### 📚 - Learn more 212 | 213 | * [mdn - Async / Await](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Async_await) 214 | * [Vue.js - Getting Started](https://vuejs.org/v2/guide/) 215 | * [Node.js - Getting Started](https://nodejs.org/en/docs/guides/getting-started-guide/) 216 | 217 | ### Video 5 - Moar JavaScript and Recap 218 | 219 | * [Wikipedia - REST Architectural Constraints](https://en.wikipedia.org/wiki/Representational_state_transfer#Architectural_constraints) 220 | 221 | ### Video 6 - Review 222 | 223 | I built a little Twilio application using [Studio](https://www.twilio.com/docs/studio?utm_source=gh-link&utm_medium=referral&utm_campaign=intro-to-apis) and some APIs to gather your feedback. 224 | 225 | Please text `FEEDBACK` to me at [(503) 461-5537](tel:+15034615537) and let me know what you thought about this course! (You can also call if that's your jam) 226 | 227 | 👋 Thanks for hanging out! 🙏 Keep me updated on your journey 💪🚀! 228 | 229 | [@craigsdennis](https://twitter.com/craigsdennis) 230 | 231 | PS. If you want to keep on learning for free, I can't recommend [the video game TwilioQuest 🎮](https://twilio.com/quest?utm_source=gh-link&utm_medium=referral&utm_campaign=intro-to-apis) enough. 232 | 233 | #### 📚 - Learn more 234 | 235 | * [📹 Understanding Webhooks on freeCodeCamp](https://www.youtube.com/watch?v=41NOoEz3Tzc) is a course I made about reverse APIs, APIs that call you instead of you calling them. Come hang out some more! 236 | -------------------------------------------------------------------------------- /motion/ebook-api.md: -------------------------------------------------------------------------------- 1 | # Fake e-book data 2 | 3 | ## URL for Author page 4 | 5 | https://api.ebooks.com/authors/b8a99e2 6 | 7 | ## Fake Response 8 | 9 | ```json 10 | { 11 | "uri": "/authors/b8a99e2", 12 | "author_id": "b8a99e2", 13 | "name": "Joanne Lipman", 14 | "books": [ 15 | { 16 | "title": "That's What She Said: What Men Need to Know (and Women Need to Tell Them) About Working Together", 17 | "uri": "/books/B0716GZT1P", 18 | "alternate_url": "https://www.amazon.com/gp/product/B0716GZT1P/" 19 | } 20 | ] 21 | } 22 | ``` 23 | 24 | ## Python loading json 25 | 26 | ```python 27 | >>> import json 28 | >>> author = json.loads(json_response) 29 | >>> author['name'] 30 | 'Joanne Lipman' 31 | >>> author['books'][0]['title'] 32 | "That's What She Said: What Men Need to Know (and Women Need to Tell Them) About Working Together" 33 | ``` 34 | -------------------------------------------------------------------------------- /motion/form-example.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |