Get started
Test mode
What a test key checks, the numbers with fixed outcomes, and what it cannot do.
A key that starts ghala_test_ sends through Ghala's sandbox. Choose the mode when you create the key in Developers, then API keys.
What a test key does
- It is checked like a live key: its scopes, your sender ID, the numbers, your suppression list and, on WhatsApp, the template.
- Nothing reaches a network.
charged_minoris0, and your wallet and ledger do not move. - Every message it sends carries
"test": true. - About two seconds after the send, each number gets its outcome. The status changes, and your webhook endpoints receive the same
message.*events a live send produces, with"test": trueindata.
Numbers with fixed outcomes
Most numbers are delivered. These give a fixed outcome, written in any form that reads as them (0700000002, +255 700 000 002):
| Number | Outcome |
|---|---|
255700000001 | delivered |
255700000002 | failed, with failure_reason and error set |
255700000003 | stays sent |
255700000004 | delivered, then read on WhatsApp |
Send to all four at once to see each event your integration must handle:
curl https://v3.ghala.io/v1/messages \
-H "Authorization: Bearer $GHALA_KEY" \
-H "Content-Type: application/json" \
-d '{"channel": "sms", "from": "ACME", "to": ["255700000001", "255700000002", "255700000003", "255700000004"], "type": "text", "text": "Testing outcomes"}'The failed one reads:
{
"phone": "255700000002",
"status": "failed",
"failure_reason": "undeliverable",
"error": "The message could not be delivered.",
"test": true
}Test and live stay apart
- Test messages stay out of the overview, analytics and spend.
GET /v1/messageslists test messages only for a test key, or with?test=true. Live and test messages never appear in the same list.- An
Idempotency-Keya test key used is refused on a live request with409 idempotency_key_reused, never replayed.
What a test key cannot do
- Campaigns. A test key cannot launch, resume or retry one:
403 forbidden. - Instagram. There is no sandbox. A test key is refused with
not_configured. - One-time codes, before your first live code. A test key's codes go to the sandbox only once your workspace has sent a code with a live key. Until then they are accepted and stay
queued. - Checking a right code. No answer, event or message history shows a code, and in test mode nobody receives it, so a test key can check the wrong-code answer but not a right one. See One-time codes.