Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1GET /api/students/42 | Aweather = requests.get("https://api.weather.com/today") | |
| 2Authorization: Bearer abc123token | BGET https://intranet.school.edu/api/timetable | |
| 3An API lets your app use a function of another piece of software by sending a defined request | CA request sent to an API asking for the data of one student, which the API answers with a response | |
| 4An internal API is built and used within your own organisation, unlike a third-party API owned by another company | DThe API key is hard-coded in the source code, so anyone with access to the code can steal it and misuse the API. | |
| 5An API is a user interface where people click buttons to use an app | EAn API is not for people to click. It is a set of defined requests that lets one piece of software use the data or functions of another. | |
| 6api_key = "sk_live_8f3a91c2" # saved in the shared code file | FA token sent with an API request to prove the caller is allowed to use the API |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
API — Application programming interface: a set of defined requests that lets one piece of software use the data or functions of another, such as sending a request and getting a response back.const res = await fetch(url);GET /students HTTP/1.1
Host: api.school.educonst options = {
headers: { "x-api-key": key }
};const res = await fetch(url);
const data = await res.json();if (res.status === 200) {
console.log("Request succeeded");
}