Skip to Content
Wapitick developers

Quickstart (5 minutes)

Send a WhatsApp message and receive a reply with a test key. No Meta account, no approval, no card.

1. Get a test key

In Wapitick, open Settings > Developers > API keys, press Create key, choose Test and copy the key (wk_test_...). It is shown once.

export WAPITICK_API_KEY=wk_test_...

A test key works only in your test workspace: a separate copy of your business with one sandbox WhatsApp number. It never reaches a real customer and never spends wallet balance, AI credits or plan quota. See Test mode.

2. Send, receive, and see the events

The sample sends the sample template hello_world to the magic number +15550100001 (simulated as delivered; a template can start a conversation, plain text needs the customer to have written in the last 24 hours), then pretends a customer replied with POST /v1/test/inbound, then lists the events your webhooks would receive.

cURL

curl.sh
#!/usr/bin/env bash
# Quickstart: channels_list -> messages_send -> test_inbound_create -> events_list (test mode)
set -euo pipefail
API="${WAPITICK_API_URL:-https://api.wapitick.com}"
AUTH="Authorization: Bearer $WAPITICK_API_KEY"

# 1. Your test workspace has one sandbox WhatsApp channel
CHANNEL=$(curl -sf "$API/v1/channels" -H "$AUTH" | jq -r '.data[0].id')

# 2. Send the sample template to a magic number: "delivered" without reaching a real phone. A template can
#    start a conversation; plain text needs the customer to have written in the last 24 hours.
curl -sf "$API/v1/messages" -H "$AUTH" -H "Content-Type: application/json" \
  -H "Idempotency-Key: quickstart-$(date +%s)" \
  -d "{\"channel_id\":\"$CHANNEL\",\"to\":{\"phone\":\"+15550100001\"},\"type\":\"template\",\"template\":{\"name\":\"hello_world\",\"language\":\"en\"}}"

# 3. Pretend a customer wrote back
curl -sf "$API/v1/test/inbound" -H "$AUTH" -H "Content-Type: application/json" \
  -H "Idempotency-Key: quickstart-in-$(date +%s)" \
  -d '{"from":"+15550100001","text":"Hi! Is this open on Sunday?"}'

# 4. Both show up as events (and at your webhook, if you added one)
sleep 3
curl -sf "$API/v1/events?type=message.*&limit=5" -H "$AUTH" | jq '[.data[] | {type, id}]'

Node

node.mjs
// biome-ignore-all lint/suspicious/noConsole: a docs sample prints its result
// Quickstart: channels_list -> messages_send -> test_inbound_create -> events_list (test mode)
import { Wapitick } from "@wapitick/node";

const wapitick = new Wapitick({
  apiKey: process.env.WAPITICK_API_KEY,
  baseUrl: process.env.WAPITICK_API_URL,
});

// 1 + 2. Send the sample template to a magic number (the SDK picks your sandbox channel): "delivered", no real
// phone involved. A template can start a conversation; plain text needs the customer to have written in 24 hours.
const sent = await wapitick.messages.sendTemplate({ to: "+15550100001", name: "hello_world" });

// 3. Pretend a customer wrote back
await wapitick.test.inbound({ from: "+15550100001", text: "Hi! Is this open on Sunday?" });

// 4. Both show up as events
await new Promise((r) => setTimeout(r, 3000));
const events = await wapitick.events.list({ type: "message.*", limit: 5 });
console.log(JSON.stringify({ sent: sent.id, events: events.data.map((e) => e.type) }));

Python

python.py
# Quickstart: channels_list -> messages_send -> test_inbound_create -> events_list (test mode)
import json
import os
import time

from wapitick import Wapitick

w = Wapitick(api_key=os.environ["WAPITICK_API_KEY"], base_url=os.environ.get("WAPITICK_API_URL", "https://api.wapitick.com"))

# 1 + 2. Send the sample template to a magic number (the SDK picks your sandbox channel). A template can start a
# conversation; plain text needs the customer to have written in the last 24 hours.
sent = w.messages.send_template("+15550100001", "hello_world")

# 3. Pretend a customer wrote back
w.test.inbound("+15550100001", "Hi! Is this open on Sunday?")

# 4. Both show up as events
time.sleep(3)
events = w.call("events_list", query={"type": "message.*", "limit": 5})
print(json.dumps({"sent": sent["id"], "events": [e["type"] for e in events["data"]]}))

PHP

php.php
<?php
// Quickstart: channels_list -> messages_send -> test_inbound_create -> events_list (test mode)
require __DIR__ . '/vendor/autoload.php';

$w = new Wapitick\Client(getenv('WAPITICK_API_KEY'), getenv('WAPITICK_API_URL') ?: 'https://api.wapitick.com');

// 1 + 2. Send the sample template to a magic number (the SDK picks your sandbox channel). A template can start a
// conversation; plain text needs the customer to have written in the last 24 hours.
$sent = $w->sendTemplate('+15550100001', 'hello_world');

// 3. Pretend a customer wrote back
$w->simulateInbound('+15550100001', 'Hi! Is this open on Sunday?');

// 4. Both show up as events
sleep(3);
$events = $w->call('events_list', [], ['type' => 'message.*', 'limit' => 5]);
echo json_encode(['sent' => $sent['id'], 'events' => array_column($events['data'], 'type')]), "\n";

Google Apps Script

apps-script.gs
// biome-ignore-all lint/correctness/noUnusedVariables: Apps Script runs these functions by name
// Quickstart in Google Apps Script: channels_list -> messages_send -> test_inbound_create (test mode)
// Script properties: WAPITICK_API_KEY (wk_test_...), optional WAPITICK_API_URL.
function wapitick_(method, path, body) {
  const props = PropertiesService.getScriptProperties();
  const base = props.getProperty("WAPITICK_API_URL") || "https://api.wapitick.com";
  const res = UrlFetchApp.fetch(base + path, {
    method: method,
    contentType: "application/json",
    headers: {
      Authorization: `Bearer ${props.getProperty("WAPITICK_API_KEY")}`,
      "Idempotency-Key": Utilities.getUuid(),
    },
    payload: body ? JSON.stringify(body) : undefined,
    muteHttpExceptions: true,
  });
  const json = JSON.parse(res.getContentText() || "null");
  if (res.getResponseCode() >= 300) throw new Error(`${json.code}: ${json.detail}`);
  return json;
}

function quickstart() {
  const channel = wapitick_("get", "/v1/channels").data[0].id;
  const sent = wapitick_("post", "/v1/messages", {
    channel_id: channel,
    to: { phone: "+15550100001" },
    type: "template",
    template: { name: "hello_world", language: "en" },
  });
  wapitick_("post", "/v1/test/inbound", { from: "+15550100001", text: "Hi! Is this open on Sunday?" });
  Logger.log(JSON.stringify({ sent: sent.id }));
}

Operations used: channels_list, messages_send, test_inbound_create, events_list.

3. Get events on your own machine

No public server yet? The CLI streams your events and forwards each one, signed, to a local URL:

npx wapitick login --key $WAPITICK_API_KEY
npx wapitick listen --forward-to http://localhost:3000/webhooks
npx wapitick trigger message.received

4. Going live

Create a live key (wk_live_...), connect your real WhatsApp number in Wapitick, and use approved templates for messages outside the 24-hour window. Read the go-live checklist first.

This page as Markdown

On this page