APIs - taking notes

⭐️ Unit 1 - What is an API
⌨️ Video 1 - Welcome (0:00:00)
⌨️ Video 2 - Defining Interface (0:03:57)
⌨️ Video 3 - Defining API (0:07:51)
⌨️ Video 4 - Remote APIs (0:12:55)
⌨️ Video 5 - How the web works (0:17:04)
⌨️ Video 6 - RESTful API Constraint Scavenger Hunt (0:22:00)
⭐️ Unit 2 - Exploring APIs
⌨️ Video 1 - Exploring an API online (0:27:36)
⌨️ Video 2 - Using an API from the command line (0:44:30)
⌨️ Video 3 - Using Postman to explore APIs (0:53:56)
⌨️ Video 4 - Please please Mr. Postman (1:03:33)
⌨️ Video 5 - Using Helper Libraries (JavaScript) (1:14:41)
⌨️ Video 6 - Using Helper Libraries (Python) (1:24:40)
⭐️ Unit 3 - Using APIs
⌨️ Video 1 - Introducing the project (1:34:18)
⌨️ Video 2 - Flask app (1:36:07)
⌨️ Video 3 - Dealing with API Limits (1:50:00)
⌨️ Video 4 - JavaScript Single Page Application (1:54:27)
⌨️ Video 5 - Moar JavaScript and Recap (2:07:53)
⌨️ Video 6 - Review (2:18:03)
Unit 1 - What is an API
API stands for Application Programming Interface. It is basically how different machines and software talk to each other to create ever more complex applications. Even though APIs can simply refer to an interface to a local library, or the libraries themselves. For purposes of this website, APIs are assumed to be over the network to connect clients and servers (or multiple servers depending on your architecture and terminology).
Video 2 - Defining Interface
Media Player APIs
Android MediaPlayer API documentation
iOS Media Player API documentation
Web Audio API
Video 3 - Defining API
mdn - Web APIs
Web APIs
When writing code for the Web, there are a large number of Web APIs available. Below is a list of all the APIs and interfaces (object types) that you may be able to use while developing your Web app or site. E.g.,
A
Audio Output Devices API Experimental
B
Background Fetch API Experimental
Background Sync Experimental
Background Tasks
Barcode Detection API Experimental
Battery API
Beacon
Bluetooth API Experimental
Broadcast Channel API
C
CSS Counter Styles
CSS Custom Highlight API Experimental
CSS Font Loading API
CSS Painting API Experimental
CSS Properties and Values API
CSS Typed Object Model API
CSSOM
Canvas API
Channel Messaging API
Clipboard API
Compression Streams API
Console API
Contact Picker API Experimental
Content Index API Experimental
Cookie Store API Experimental
Credential Management API
Video 4 - Remote APIs
SOAP vs. REST
REST APIと似たものとして「SOAP API(SimpleObject Access Protocol API)」が挙げられます。REST APIとSOAP APIはいずれもHTTPプロトコルを活用するものの、SOAP APIはWebアプリケーション同士がそれぞれ異なるプログラミング言語で構成されていても通信を行える点が特徴です。
しかし、SOAP APIはREST APIに比べて負荷が大きく、スピードも遅くなる傾向にあります。とは言えデータ通信面やセキュリティ面の安全性にも優れているため、REST APIと同様に企業からのニーズが高いと言えるでしょう。
SOAPとは
SOAPは、Simple Object Access Protocolの略称で、Webサービスでのデータ交換に使用されるプロトコルです。SOAPは、XMLベースのメッセージングプロトコルであり、Webサービスの呼び出しや応答を記述するための仕様を提供します。
SOAPの主な特徴は、以下のようになります。
XMLベース: SOAPは、XMLを使用してメッセージを記述するため、クロスプラットフォームで相互運用性が高いです。
プロトコル中立性: SOAPは、HTTPだけでなく、SMTPやJMSなどの異なるプロトコルでも使用することができます。
拡張性: SOAPは、XMLスキーマやWSDL(Web Services Description Language)と組み合わせることで、メッセージフォーマットの拡張性を提供します。
メッセージ処理の信頼性: SOAPは、メッセージの転送や処理中のエラーを検出するための信頼性の高いメカニズムを提供します。
セキュリティ: SOAPは、SSL(Secure Sockets Layer)やデジタル署名などのセキュリティ機能を提供します。
SOAPは、Webサービスの開発において広く使用されていましたが、近年はRESTful APIが主流となり、SOAPの使用は減少しています。
https://apidog.com/jp/blog/how-rest-differs-from-soap/
REST
Representational State Transfer
Web APIとRESTful APIのちがい
REST APIs use the HTTP protocol to send and receive data. Web APIs, on the other hand, rely on multiple communication protocols like SOAP, XML-RPC, and JSON-RPC.
Video 5 - How the web works
mdn - How the web works
Clients and servers
Computers connected to the internet are called clients and servers. A simplified diagram of how they interact might look like this:
Two circles representing client and server. An arrow labelled request is going from client to server, and an arrow labelled responses is going from server to client
Clients are the typical web user's internet-connected devices (for example, your computer connected to your Wi-Fi, or your phone connected to your mobile network) and web-accessing software available on those devices (usually a web browser like Firefox or Chrome).
Servers are computers that store webpages, sites, or apps. When a client device wants to access a webpage, a copy of the webpage is downloaded from the server onto the client machine to be displayed in the user's web browser.
Video 6 - RESTful API Constraint Scavenger Hunt
Unit 2 - Exploring APIs
Video 2 - Using an API from the command line
Twilio
Twilio Console
SMS Getting Started
Check out the jq tutorial for parsing JSON on the command line
``python
require 'rubygems'
require 'twilio-ruby'
@account_sid = '‹ACCOUNT_SID›'
@auth_token = # your authtoken here
set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(@account_sid, @auth_token)
@account = @client.account
@message = @account.sms.messages.create({:from =›'+81‹twilio番号›', :to =›'あて先携帯番号', :body =›'★SMS本文★'})
puts @message
``
Video 3 - Using Postman to explore APIs
⬇️ - Download Postman
The Twilio Messages API URL is:
https://api.twilio.com/2010-04-01/Accounts/<Your Account SID Here>/Messages.json
Make sure to replace that SID with your Account SID which can be found in the Twilio console
Video 4 - Please please Mr. Postman
⬇️ - Many wonderful API Collections can be downloaded for exploration in the Postman API Network
📚 - Learn more
How Collaboration Works in Postman
Wikipedia - Boilerplate code
Video 6 - Using Helper Libraries (Python)
Install Python 3
To use the Twilio Python Helper Library
pip install twilio
Unit 3 - Using APIs
Video 1 - Introducing the project
Glitch
Slack API
Sportsball APIs
Philips Hue API
Video 2 - Flask app
Twilio docs - Create a Message with Python
Twilio docs - List all Messages with Python
Flask documentation
Environment Variables
Video 3 - Dealing with API Limits
Nordic APIs - Everything You Need To Know About API Rate Limiting
Video 4 - JavaScript Single Page Application
mdn - Async / Await
Vue.js - Getting Started
Node.js - Getting Started
Video 5 - Moar JavaScript and Recap
Wikipedia - REST Architectural Constraints