Teach API testing with a 60-minute hands-on workshop

Use Fun API as a practice service for a classroom or team learning session. Learners can use the browser playground or a network client. Each learner should generate their own X-Sandbox-ID for network requests; the browser playground keeps its own local state. No Fun API signup is needed. These materials do not include a gradebook, certification or managed classroom service.

60-minute lesson

  1. 5 minutes: Introduce the request contract

    Explain method, URL, query, headers, status and body. Distinguish browser simulation from the live /api service.

  2. 5 minutes: Prepare isolated clients

    Choose browser sandbox or a network tool. For network calls, generate one UUID per learner and send it as X-Sandbox-ID. Use only the sample data.

  3. 10 minutes: Read and assert

    Complete exercises 1 and 2. Ask learners to explain why the missing-resource test passes with a 404.

  4. 10 minutes: Filter and reject invalid input

    Complete exercises 3 and 4. Check every item, and reject an invalid query value explicitly.

  5. 10 minutes: Handle unusual statuses

    Complete exercise 5. Compare an expected training failure with an unexpected outage.

  6. 10 minutes: Revalidate a cached representation

    Complete exercise 6 with a live network client. Preserve the ETag exactly and inspect the empty 304 body.

  7. 10 minutes: Review and reproduce

    Learners exchange assertion descriptions or sanitized collections, rerun with their own sandbox, and explain one pitfall. Use the challenge page for further practice.

Six exercises and expected results

  1. 1. Assert an existing resource

    GET /api/friends/v1/characters/1. Expect 200, JSON, id = 1 and a nonempty name. Explain why checking only the status is incomplete.

  2. 2. Prove the missing case

    GET /api/friends/v1/characters/999999. Expect 404 and error = Not Found. Keep a separate assertion from exercise 1.

  3. 3. Validate every filtered item

    GET /api/pizza/v1/menu?vegetarian=true. Expect 200, nonempty data, total equal to data.length and vegetarian = true on every item.

  4. 4. Test the input boundary

    GET /api/pizza/v1/menu?vegetarian=sometimes. Expect 400 and error = Bad Request. Compare with the valid true/false filter.

  5. 5. Recognize deliberate errors

    GET /api/coffee/v1/teapot and GET /api/pizza/v1/oven/status. Expect 418 and 500 respectively. Explain why these requests are successful tests of intentional failures.

  6. 6. Revalidate with an ETag

    GET /api/football/v1/standings, save ETag, then repeat in the same sandbox with If-None-Match. Expect 200 then 304, the same ETag and no second response body.

Download lesson and answer notes · Download practice collection

The public playground is free and requires no Fun API account. Class progress stays on each learner’s device. A shared instructor dashboard, paid team plan and service-level agreement are not offered.

Last updated