DA7: APIs and webhooks

Lesson 2 of 5 · reading 15–25 minutes; practice and project time is on the module page

Making requests with the HTTP Request node

🎯You'll be able to

Make GET and POST requests with the HTTP Request node, sending headers, query parameters and a JSON body, and read the reply status.

🏠The everyday picture

Filling in a courier booking form: you choose the service, write the address in the right boxes, attach your ID, and hand it over. The counter clerk gives you a receipt, or tells you what's missing.

📘What it really is

📝A worked example

Creating a ShipFast shipment after an order is paid:

POST https://api.shipfast.example/v2/shipments
Headers: X-Api-Key: (from credentials)   Content-Type: application/json
Body:
{
  "reference": "{{ $json.order_id }}",
  "name": "{{ $json.customer.name }}",
  "phone": "{{ $json.customer.phone_e164 }}",
  "pincode": "{{ $json.address.pincode }}",
  "weight_grams": {{ $json.weight_grams }}
}

The first test returns 422 with "pincode must be 6 digits": the shop sent "110 001" with a space. You clean the pin code in the mapping step, and the next test returns 201 Created with an AWB number, which the workflow saves to the order.

🌍Where it's used

📝Case scenario

A request to a CRM returns 404 Not Found for every contact. The URL is /v1/contact/123, but the docs say /v1/contacts/123, plural. One letter fixes it. You add the correct endpoints to the API card and copy URLs from the docs rather than typing them.

🖱️Try it

Use a free public test API (search for "JSON placeholder API") with an HTTP Request node: make a GET for a list, a GET for one item, and a POST that creates one. Note the status code each returns.

⚠️Common mistakes

🛠️For your project

Project 1 calls POST /accounts/invoices; try it by hand first and read the 201, 200 (repeat key) and 422 replies.

✅Quick check

What does a 422 reply usually mean?

Show the answer

The data you sent failed the API's validation; the reply usually says which field.

What's the difference between query parameters and the body?

Show the answer

Query parameters sit in the URL, usually to filter or page results; the body carries the data you're creating or updating.

← PreviousReading API documentation
ProLearners Assist