In one sentence
Students understand HTTP and REST, and build a real API with a webhook, security and JSON responses.
Preparation before the session
Time plan
- 00:00โ00:15 Review: the smart form
- 00:15โ00:45 APIs and HTTP: the way systems talk
- 00:45โ01:15 Custom webhooks and data structures
- 01:15โ01:30 โ Break
- 01:30โ01:50 Webhook response and security
- 01:50โ02:15 The HTTP module: auth, query, body
- 02:15โ02:50 Building together: a lead-intake API
- 02:50โ03:00 Summary and practice
Lecture parts and activity type
| Part | Activity type |
|---|---|
| What is an API? | Explanation |
| Webhook โ when the system calls you | Explanation + demo |
| Webhook response โ returning an answer | Simulation |
| Securing a webhook | Demo |
| The HTTP module in depth | Demo |
| Make an API call โ the middle way | Explanation |
| Building together: a lead-intake API | Building together |
The 3 messages that must get across
- Push is better than pull when possible.
- Return the response early.
- Every production webhook is secured.
Questions for class discussion
- Which systems in your organization can send webhooks?
- What's the risk in an unsecured webhook?
- Who in the organization needs to see API docs?
Live demo script
Talking to an API
- GET โ HTTP โ Make a request, the users/1 URL, Parse response โ Run once.
- Query โ URL: โฆ/posts, Query parameters: userId = 1. In the bubble: Data is an array โ {{length(1.data)}}.
- POST โ Method POST, Body type Raw, Content type JSON, Request content: {"title":"Hello","body":"from Make","userId":1}.
- Status โ In the bubble: Status code 201.
A first webhook with a response
- Webhook โ Webhooks โ Custom webhook โ Add โ hello โ copy.
- Send โ Run once โ Hoppscotch POST with a JSON body.
- Create JSON โ JSON โ Create JSON โ data structure: Generate from {"greeting":"x"} โ greeting = Hello {{1.name}}!.
- Response โ Webhooks โ Webhook response: status 200, body = the JSON string, Content-Type header.
- ON โ Scheduling Immediately โ ON โ send another request.
A secure leads API
- Webhook โ Custom webhook Leads API, Get request headers: Yes.
- Authentication โ Router: a route with a filter on the header = course-2026-secret; fallback โ Response 401 {"ok":false,"error":"unauthorized"}.
- Validation โ An inner Router: email Matches pattern; fallback โ Response 400 {"ok":false,"error":"invalid email"}.
- Enrichment โ Set multiple variables: clean name/email/phone, domain, score, leadId.
- Response โ Create JSON โ Webhook response 201.
- Tests โ Hoppscotch: no key (401), a wrong email (400), valid (201).
Problems students will run into
| Problem | Quick fix |
|---|---|
| 400 on the POST | Content type isn't JSON, or the JSON is invalid. |
| Special characters appear as \u05e9 | That's fine โ it's encoded JSON. Parse response returns normal text. |
| I got Accepted | The scenario isn't ON and isn't in Run once, or Webhook response isn't in the chain. |
| Garbled characters | Add charset=utf-8 to Content-Type. |
| Always 401 | Get request headers is off, or the header name is in capital letters in the comparison. |
| Both the fallback and a normal route ran | The fallback wasn't ticked โ it's set up as a route with an empty filter. |
| 429 | The free API has a daily quota. Switch to Webhook.site for testing. |
| gender null | The name isn't known โ that's fine, handle it with ifempty. |
Tips from the classroom
- Demonstrate the difference between Accepted and a tailored response โ it's an "aha" moment.
- Hoppscotch in the browser saves installations.
- Spend time reading an API's error response.
Adapting to different levels
For students who struggle: Webhook + response only, without security.
For fast students: The batch and HMAC challenges.
Answer key โ multiple-choice questions
Students see the answers in shuffled order, so the key gives the wording of the right answer.
| # | Right answer |
|---|---|
| 1 | Webhook = the system sends to us when there is an event; polling = we ask every X minutes |
| 2 | Get request headers: Yes in the webhook |
| 3 | Too many requests โ slow down |
| 4 | It prevents broken JSON when there are quotes/lines/special characters |
| 5 | Call any endpoint with an existing connection's auth |
| 6 | As early as possible, before slow actions |
| 7 | 4xx/5xx won't stop the scenario |
| 8 | Webhooks โ the queue |
Homework
- The API should return 3 correct responses.
- Preparing for session 5: make sure you have access to Google Sheets, Gmail, Drive and Calendar in the course account.