APIs are all around you
An API is an agreed way for two pieces of software to talk to each other. You don't need to know how the other system works inside. You only need to know what to ask for and how to ask for it.
Amara doesn't have a developer on staff. She connected her tools with a few small cloud functions: short scripts that run on Google Cloud whenever something happens. When a customer checks out on Solebound's Shopify store, nobody emails Amara the order. Shopify sends an HTTP request to a web address her function is listening on, with the order packed inside as JSON. The function reads it and updates the stock count. That exchange is an API call.
APIs are how the modern internet works. Every app you've used today has made dozens of them. They aren't only for developers. They're the language connected systems use to talk, and understanding them is the first step to building those connections.
Anatomy of an API request
Every request has the same four parts, and every response has three. Click each highlighted part of this real-world Shopify request to see what it does and why it matters.
Figure 2.1 A real Shopify request and its response. Select any highlighted part.
Solebound's API sandbox
This is a working pretend API that runs in your browser. Edit any part of the request and send it. The server checks your key, the address, your data and how fast you're calling, just like a real one would. Start from an example, then try to break it.
sb_live_demo_4f8a2cIt can read orders and stock, change product prices and send texts. It can't create or delete orders. That's on purpose.
Every one of these is reachable from the sandbox. Click a code for a hint.
Authentication and API keys
An API lives at a public web address. Without authentication, anyone who found the address could call it. Auth is how an API knows you're allowed to be there, and what you're allowed to do.
Figure 4.1 Every request is checked before the server does any work.
Reading API documentation
Reading docs well is what separates someone who can use any API from someone who can only use the ones they were taught. Here's the page for the endpoint you used in the sandbox. Open each section, then test what it says.
Knowledge check
Six questions on requests, status codes, authentication and documentation. A few ask you to predict what a server will do, which you've already seen happen in the sandbox.