Course outline
Module 1
Module 1: What an API Is: The Core Idea
What an API Is: The Core Idea
Knowledge check
Q1. What does API stand for?
- A. Application Programming Interface ✓
- B. Automated Program Integration
- C. Applied Protocol Infrastructure
- D. Advanced Platform Input
Why: API stands for Application Programming Interface, a set of rules and definitions that lets software components communicate with each other.
Q2. Which best describes the core idea of an API?
- A. A physical device that connects two computers
- B. A defined way for one piece of software to request services or data from another ✓
- C. A programming language used to build websites
- D. A type of database that stores user passwords
Why: An API defines how software components interact, specifying the requests that can be made and the responses that will be returned.
Q3. A weather app on your phone displays current temperatures fetched from a weather service. What role does the API play here?
- A. It stores the weather data permanently on your phone
- B. It allows the app to request and receive weather data from the service without needing to build its own weather system ✓
- C. It replaces the phone's operating system
- D. It converts the temperature from Celsius to Fahrenheit
Why: The API acts as the intermediary, letting the app ask the weather service for data and receive it in a structured format.
Q4. Which analogy is commonly used to explain what an API does?
- A. A library that stores books permanently
- B. A waiter who takes your order to the kitchen and brings back your food ✓
- C. A car engine that powers a vehicle
- D. A map that shows the location of streets
Why: Like a waiter, an API takes a request from one party, delivers it to another system, and returns the response without the requester needing to know the kitchen's internal workings.
Q5. Why is an API useful to a developer?
- A. It requires the developer to rewrite the entire internal code of other services
- B. It lets developers use functionality from other systems without needing to know how that functionality is implemented internally ✓
- C. It makes all software free of charge
- D. It eliminates the need for any user interface
Why: APIs hide internal complexity, so developers can reuse existing services like payment processing or mapping without rebuilding them.
Module 2
Module 2: How APIs Connect Software Systems
How APIs Connect Software Systems
Knowledge check
Q1. What does API stand for?
- A. Application Programming Interface ✓
- B. Automated Program Integration
- C. Applied Protocol Infrastructure
- D. Advanced Programming Input
Why: API stands for Application Programming Interface, a set of rules and definitions that lets software components communicate with each other.
Q2. Which best describes the role of an API in connecting software systems?
- A. It stores all of a application's data permanently on the user's device
- B. It defines a set of requests and responses that let one system use the functionality of another ✓
- C. It replaces the need for a database in any software project
- D. It compiles source code into machine-readable binary files
Why: An API defines how systems request and receive data or services from each other, allowing one application to use another's functionality without knowing its internal workings.
Q3. A weather app on your phone shows current temperatures by retrieving data from a weather service. What is the weather service's API most like?
- A. A restaurant menu that lists what dishes the kitchen can prepare ✓
- B. A kitchen that cooks the food itself
- C. A delivery driver who carries food from the kitchen to your table
- D. A recipe book stored inside your refrigerator
Why: Like a menu, an API lists the available requests (such as getting current temperature) and the format of what you will receive, without exposing how the kitchen or service works internally.
Q4. What is an endpoint in the context of an API?
- A. The final line of code in a program
- B. A specific URL where an API can be accessed to perform a particular function or retrieve particular data ✓
- C. The point at which a user logs out of an application
- D. A hardware device that stores server backups
Why: An endpoint is a specific URL that represents a resource or function in an API, such as one that returns a list of users or current weather data.
Q5. Why do APIs matter for software development?
- A. They allow developers to reuse existing services and integrate features without building everything from scratch ✓
- B. They make all software run at the same speed regardless of hardware
- C. They eliminate the need for internet connections in modern applications
- D. They guarantee that software will never contain security vulnerabilities
Why: APIs let developers build on existing services such as payment processing or maps, saving time and effort while connecting different systems together.
Module 3
Module 3: Requests, Responses, and Data Formats
Requests, Responses, and Data Formats
Knowledge check
Q1. In an API request, which part typically specifies the action to perform on a resource, such as retrieving or creating data?
- A. The HTTP method (for example GET, POST, PUT, or DELETE) ✓
- B. The response body
- C. The status bar of the browser
- D. The file extension of the server
Why: The HTTP method tells the server what action to take: GET retrieves data, POST creates it, PUT updates it, and DELETE removes it.
Q2. What does the HTTP status code 404 indicate in an API response?
- A. The request was successful
- B. The server encountered an internal error
- C. The requested resource could not be found ✓
- D. The request requires authentication
Why: A 404 Not Found status means the server could not locate the resource at the requested URL. A 200 means success and 500 indicates a server error, while 401 signals missing authentication.
Q3. Which data format is most commonly used to structure data in API responses today?
- A. JSON
- B. PNG
- C. MP3
- D. DOCX
Q4. Which of the following is a valid example of JSON data?
- A. {"name": "Alice", "age": 30}
- B. <name>Alice</name><age>30</age>
- C. name=Alice;age=30;
- D. Name: Alice, Age: 30
Q5. Why is it important for a client to set the Content-Type header in a POST request that sends JSON data?
- A. It makes the request run faster on the network
- B. It tells the server how to interpret the body of the request
- C. It encrypts the data sent to the server
- D. It automatically generates a response from the server
Module 4
Module 4: Types of APIs: REST, GraphQL, and More
Types of APIs: REST, GraphQL, and More
Knowledge check
Q1. What does REST stand for?
- A. Remote Execution and Synchronization Tool
- B. Representational State Transfer ✓
- C. Reliable Event Streaming Technology
- D. Resource Extension and Session Transfer
Why: REST stands for Representational State Transfer, an architectural style for designing networked applications that uses standard HTTP methods and stateless communication.
Q2. Which HTTP method is typically used in a REST API to retrieve data from a resource?
- A. POST
- B. GET ✓
- C. DELETE
- D. PATCH
Why: GET is the HTTP method used to retrieve data from a resource without modifying it. POST creates resources, DELETE removes them, and PATCH partially updates them.
Q3. What is a key feature of GraphQL compared to REST?
- A. It only works with XML data
- B. Clients can request exactly the fields they need in a single query ✓
- C. It requires a separate endpoint for every resource
- D. It cannot be used over HTTP
Why: GraphQL lets clients specify exactly which fields they want in one query, reducing over-fetching and under-fetching compared to REST, which often returns fixed data structures from multiple endpoints.
Q4. In a REST API, what does it mean for the server to be 'stateless'?
- A. The server stores no data at all
- B. Each request must contain all the information needed to process it, with no session stored on the server between requests ✓
- C. The server can only handle one request at a time
- D. The API cannot use authentication
Why: Statelessness means the server does not retain client context between requests. Every request carries the information needed to be understood on its own, such as an auth token.
Q5. Which API type is commonly used for real-time, bidirectional communication such as chat applications?
- A. SOAP
- B. REST
- C. WebSockets ✓
- D. CSV export
Why: WebSockets provide a persistent, two-way connection between client and server, making them well suited for real-time features like chat, live notifications, and multiplayer games.
Module 5
Module 5: Authentication and Keeping APIs Secure
Authentication and Keeping APIs Secure
Knowledge check
Q1. What is the main purpose of an API key in a web API?
- A. To compress data sent between the client and server
- B. To identify and authenticate the calling application or user ✓
- C. To encrypt the contents of the API response
- D. To cache responses so they load faster
Why: An API key is a unique credential that tells the server which application or user is making the request, so the server can authenticate the caller and apply appropriate access rules and rate limits.
Q2. Which HTTP status code indicates that a request failed because the client did not provide valid authentication credentials?
- A. 200 OK
- B. 403 Forbidden
- C. 401 Unauthorized ✓
- D. 500 Internal Server Error
Why: 401 Unauthorized means the request lacks valid authentication credentials. 403 Forbidden means the server understood the credentials but the caller is not allowed to perform the action.
Q3. Why should API keys never be embedded directly in publicly accessible front-end JavaScript code?
- A. Because JavaScript cannot send HTTP headers
- B. Because anyone can view the source code and copy the key, allowing unauthorized use ✓
- C. Because API keys only work on the server side of an application
- D. Because browsers automatically delete keys after each page load
Why: Client-side code is visible to anyone who opens the browser's developer tools or views the page source, so a key embedded there is effectively public and can be stolen and misused.
Q4. What does the OAuth 2.0 access token represent?
- A. The user's permanent password stored in encrypted form
- B. A temporary credential granting limited access to specific resources on behalf of a user ✓
- C. The server's private encryption key
- D. A list of all the user's previous login attempts
Why: An OAuth 2.0 access token is a short-lived credential that grants a client application limited, scoped access to resources on behalf of a user, without exposing the user's password to that application.
Q5. Which practice best helps keep an API secure over time?
- A. Using the same API key for all environments and never changing it
- B. Sending credentials in the URL query string so they are easy to log
- C. Rotating keys periodically and transmitting all requests over HTTPS ✓
- D. Disabling authentication so that developers can debug more easily
Why: Regularly rotating credentials limits the damage if a key is leaked, and HTTPS encrypts traffic in transit so credentials cannot be easily intercepted. Query-string credentials can leak into logs, and disabling authentication exposes the API to anyone.
Module 6
Module 6: APIs in Everyday Apps and Services
APIs in Everyday Apps and Services
Knowledge check
Q1. What does API stand for?
- A. Application Programming Interface ✓
- B. Automated Program Integration
- C. Advanced Protocol Installation
- D. Application Process Input
Why: API stands for Application Programming Interface, a set of rules and tools that lets one software program interact with another.
Q2. When you check the weather in a weather app, which best describes the role of an API?
- A. It stores the weather data permanently on your phone
- B. It sends your request to a weather service and returns the forecast data to the app ✓
- C. It replaces the weather service with a local sensor
- D. It changes the weather conditions in your area
Why: The app uses an API to send a request to a weather provider's servers, which return the data for the app to display.
Q3. Which everyday example best illustrates an API at work?
- A. Typing a document in a word processor without internet
- B. A travel app showing flight prices pulled from multiple airline systems ✓
- C. Charging your phone with a cable
- D. Saving a photo to your device's gallery
Why: The travel app gathers flight data from airline systems through their APIs, combining it into one display for the user.
Q4. What is an analogy often used to explain how an API works?
- A. A fire extinguisher
- B. A waiter who carries requests from a customer to the kitchen and brings back the food ✓
- C. A bicycle chain
- D. A library's bookshelf layout
Why: Like a waiter, an API takes a request from one party, delivers it to another system, and returns the response without the requester needing to enter the kitchen.
Q5. Why do many apps rely on APIs instead of building every feature themselves?
- A. APIs make phones run faster by deleting old files
- B. APIs let developers reuse services like maps, payments, and login from other providers ✓
- C. APIs are required by law for all mobile apps
- D. APIs remove the need for internet connections
Why: APIs let developers add features like maps, payments, or social login by connecting to existing services, saving time and effort.
Module 7
Module 7: Why APIs Matter for Business and Innovation
Why APIs Matter for Business and Innovation
Knowledge check
Q1. What does API stand for?
- A. Application Programming Interface ✓
- B. Automated Program Integration
- C. Applied Processing Index
- D. Advanced Protocol Internet
Why: API stands for Application Programming Interface, a set of rules and protocols that lets different software applications communicate with each other.
Q2. Which business benefit is most commonly associated with using APIs?
- A. Eliminating the need for any software development
- B. Enabling integration with partners and third-party services without rebuilding them ✓
- C. Guaranteeing zero security risks
- D. Replacing all internal databases
Why: APIs let businesses connect with partners and external services, such as payment processors or mapping tools, without building those capabilities from scratch.
Q3. How do APIs support innovation in businesses?
- A. They prevent other companies from accessing data
- B. They allow developers to build new products by combining existing services ✓
- C. They remove the need for customers
- D. They only work for large enterprises
Why: By exposing functionality as services, APIs let developers combine existing capabilities in new ways, speeding up the creation of new products and features.
Q4. Which of the following is a real-world example of an API in everyday use?
- A. A printed paper manual
- B. A payment button on an online store that connects to a payment provider ✓
- C. A handwritten invoice
- D. A physical storefront sign
Why: A payment button on an online store typically uses a payment provider's API to securely process transactions without the store building its own payment system.
Q5. What is a common business risk that organizations must manage when exposing APIs?
- A. Too many customers visiting the website
- B. Unauthorized access and data security vulnerabilities ✓
- C. Slower internet speeds for employees
- D. Higher office rental costs
Why: Exposing APIs can create entry points for unauthorized access or data breaches, so businesses need authentication, authorization, and monitoring to manage this risk.