· 2 min · TextMeFlow Team

Send a WhatsApp Confirmation After a Typeform Submission

Typeform is often used for intake forms, registrations or request forms because it's pleasant to fill in on mobile. The downside: without extra tooling, you only notice a new submission when you happen to open the dashboard. Unlike Google Forms, Typeform does have a built-in webhook — so you don't need Apps Script or an intermediate layer to send a WhatsApp message the moment someone clicks "submit".

This article shows how to connect that native webhook directly to the TextMeFlow API with a small PHP endpoint.

How it works

On every submission, Typeform can send a POST request to a URL you specify, with the full answers as a JSON payload. That endpoint doesn't need to do anything complicated: it reads the relevant fields from the payload and calls the TextMeFlow API to send the WhatsApp message.

So two parts:

  1. The webhook setting in your Typeform form
  2. A PHP script that receives the payload and forwards it to TextMeFlow

Step 1: add a webhook in Typeform

In the Typeform editor, go to Connect → Webhooks → Add a webhook and enter the URL of your own endpoint (for example https://yourdomain.com/typeform-hook.php). Typeform signs every request with an HMAC-SHA256 signature in the Typeform-Signature header, calculated with a secret you set yourself when creating the webhook. Keep that secret — you need it to verify that an incoming request really comes from Typeform and hasn't been forged.

Step 2: the PHP endpoint

<?php
$secret = "JOUW_TYPEFORM_WEBHOOK_SECRET";
$body = file_get_contents("php://input");

$signature = "sha256=" . base64_encode(hash_hmac("sha256", $body, $secret, true));
if (!hash_equals($signature, $_SERVER["HTTP_TYPEFORM_SIGNATURE"] ?? "")) {
    http_response_code(401);
    exit("invalid signature");
}

$payload = json_decode($body, true);
$answers = $payload["form_response"]["answers"] ?? [];

$naam = "onbekend";
$telefoon = null;

foreach ($answers as $antwoord) {
    if ($antwoord["field"]["ref"] === "naam") {
        $naam = $antwoord["text"] ?? $naam;
    }
    if ($antwoord["field"]["ref"] === "telefoon") {
        $telefoon = $antwoord["phone_number"] ?? null;
    }
}

$tekst = "Thanks for your submission, {$naam}! We'll be in touch soon.";

$ch = curl_init("https://textmeflow.eu/api/messages");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json",
        "Authorization: Bearer JOUW_API_KEY",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "to" => $telefoon,
        "message" => $tekst,
    ]),
]);
curl_exec($ch);
curl_close($ch);

http_response_code(200);

You need to adjust the ref values ("naam", "telefoon") to the field IDs from your own form — you set those yourself per question under Field settings → Ref. The full overview of parameters and endpoints of the TextMeFlow API is at /en/docs/api; for how to verify incoming webhook signatures more generally (including TextMeFlow's own outgoing webhooks), read /en/blog/verify-whatsapp-webhook-signatures.

Only confirm when there is consent

Only send a WhatsApp message to the phone number from the form if the person explicitly agreed to it — for example via a checkbox question ("I consent to being contacted via WhatsApp"). Without that consent you're, in principle, sending unsolicited messages, which also damages your sending reputation over time.

Things to watch

  • Phone number format: Typeform's phone_number question type usually already delivers an international format, but check this before you send — the TextMeFlow API expects a valid E.164 number without a leading + or 00.
  • Rate limits: during a spike in submissions (e.g. after a marketing campaign) you may run into your plan's standard rate limits. The exact limits per plan and the error responses are in /en/docs/rate-limits.
  • Error handling: check the HTTP status code of the curl call. On a 4xx or 5xx response from TextMeFlow, it's best to log it, so a failed send doesn't get lost silently.
  • No server of your own? Without PHP hosting you can build the same flow without code through an automation tool — see /en/docs/integrations for the n8n/Make/Zapier approach.

Conclusion

Because Typeform offers native webhooks, the shortest route to an automatic WhatsApp confirmation is a small, stateless endpoint that translates the payload into an API call — no extra subscription or intermediate layer needed. For more complex flows with several follow-up steps (CRM update, Slack notification, creating a task), an automation tool is your best bet.

No account yet? You can start for free with 50 messages per month, forever — no credit card needed. Create a free account.

Want to send WhatsApp messages via API yourself?

Free forever up to 50 messages/month. Scan a QR and send your first message within 5 minutes.

Free forever