Test a complete response matrix
See this course’s project requirements
A tested local API-response viewer with a request contract, validation rules, six response cases and an honest integration handoff.
Keep your working files in your own notebook or software. Save a private description, checklist, and work link in My Proof.
What to include
- Request/response contract with limits.
- Type and status observations.
- Working local viewer.
- Explicit empty/error/validation behavior.
- Six-case test matrix and README.
Review and revise
Use these criteria to check your work and choose what to improve.
- Fields and types are understood.
- Failures do not show stale results.
- All six cases behave as described.
- Simulation and live-integration limits are explicit.
Want more background?
The idea in everyday life
Build a read-only viewer for a fictional library-hours API contract.
A response matrix tests categories of behavior, not just one happy example.
Test a complete response matrix — guided practice
Demonstrate accepted, empty, malformed and error cases in a repeatable handoff.
Save api-viewer.html from the download and open it in a modern browser. Open its source in a text editor. The complete original file supplies every fixture and function. It simulates GET /hours locally; it does not contact a real library. Reload after edits; restore the supplied file before each lesson unless told otherwise.
1. Restore the original
Replace any experimental changes with the supplied api-viewer.html.
You should see: The initial two branch durations are 8 and 5.
A known starting state makes the test record reproducible.
2. Run six cases
Run success, empty, missing, wrong-type, server-error and malformed in that order.
You should see: Only success has two list items; empty is valid with zero; four cases report errors.
Each case probes a different response assumption.
3. Record exact evidence
Use test-log.md to record case, status/list count and whether the button can run again.
You should see: All six cases leave the button enabled after completion.
Recovery is part of correct behavior.
4. Package
Save viewer, test log and a README saying local simulation, schema, limitations and optional live-integration requirements.
You should see: Another learner can reproduce the cases without an account.
The handoff distinguishes demonstrated logic from untested transport.
What to finish
A tested local API viewer, contract note and response matrix.
Watch for this
Counting a simulated test as evidence of live API integration.
How can I tell I understand it?
Complete the changed case, explain your result, and pass the three application checks.
Quick knowledge check
Answer all 3 questions. Get at least 2 right and the lesson completes automatically.
You’ll get an explanation for each answer. Signed in? Your results save to your account.
Pass the check. We’ll save the progress.
Answer all 3 questions above and get at least 2 right. You can review the explanations and try again.
Go to the knowledge checkOptional course overview video · same video as Lesson 1
APIs for Beginners - How to use an API (Full Course / Tutorial)
From freeCodeCamp.org. Watch here or open it on YouTube .
Optional course overview. Follow the written steps below at your own pace.Tools, templates, and lesson sources
Tools and templates
Tools open in a new tab so you can keep your place here.
Sources and further reading
Explore the references behind this lesson.
Source & access notes · checked 2026-09-12
Opened and inspected on 2026-09-12: JSON types and parsing.
Access: Free public web page; no paid enrollment required.
Reuse: Public reference; link only. LifeStarter prose, exercises and files are independently authored.
Source & access notes · checked 2026-09-12
Opened and inspected on 2026-09-12: Responses, promises and explicit HTTP status checks.
Access: Free public web page; no paid enrollment required.
Reuse: Public reference; link only. LifeStarter prose, exercises and files are independently authored.
Source & access notes · checked 2026-09-12
Opened and inspected on 2026-09-12: 200, 404 and server-error categories.
Access: Free public web page; no paid enrollment required.
Reuse: Public reference; link only. LifeStarter prose, exercises and files are independently authored.
Report a problem with this lesson
Tell us what went wrong. Please leave out personal information and private project contents.