| Schemes | whatsapp:// |
| Cargo feature | service-whatsapp |
| Service | https://developers.facebook.com/docs/whatsapp/cloud-api/get-started |
| Body formats | text (first is the default) |
| Attachments | no |
| Title length | no title (merged into the body) |
| Body length | 1,024 characters |
| Body lines | unlimited |
| Request throttle | 200 ms between requests |
| Vendor URLs accepted | no |
URL formats
{schema}://{token}@{from_phone_id}/{targets}
{schema}://{template}:{token}@{from_phone_id}/{targets}
{schema} is one of whatsapp://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{from_phone_id} | From Phone ID | string | yes | secret; must match ^[0-9]+$ | |
{language} | Language | string | no | en_US | must match ^[^0-9\s]+$ |
{target_group} | Target Group ID | string | no | prefix #; must match ^[0-9]{16,}$ | |
{target_phone} | Target Phone No | string | no | prefix +; must match ^[0-9\s)(+-]+$ | |
{targets} | Targets | list | yes | any of target_group, target_phone; separated by / | |
{template} | Template Name | string | no | must match ^[^\s]+$ | |
{token} | Access Token | string | yes | secret; must match ^[a-z0-9]+$ |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
from | From Phone ID | string | sets {from_phone_id}; also source | |
lang | Language | string | sets {language} | |
template | Template Name | string | sets {template} | |
to | Targets | list | sets {targets} | |
token | Access Token | string | sets {token} |
Prefixed parameters:
:name=value: Template Mapping
The common URL parameters (format, overflow, verify, redirect, cto, rto, retry, wait, store, tag, tz, user, password, port, optional, emojis) apply as well.
Examples
Accepted URLs (tokens are fake):
whatsapp://eeeeeeee@12345/44444444444
whatsapp://eeeeeeee@12345/123/44444444444/abcd/
whatsapp://eeeeeeee@12345/44444444444/120363043968066561@g.us
whatsapp://eeeeeeee@12345/44444444444?:1=test
whatsapp://template:eeeeeeee@12345/44444444444?lang=fr_CA
whatsapp://template:eeeeeeee@12345/44444444444?:1=test&:body=3&:type=2
whatsapp://_?token=eeeeeeee&source=54321&to=44444444444
whatsapp://eeeeeeee@12345/44444444444?template=template&lang=fr_CA&language=de_DE
Rejected URLs:
whatsapp://template:eeeeeeee@12345/44444444444?lang=1234
whatsapp://%20:eeeeeeee@12345/44444444444
whatsapp://template:eeeeeeee@12345/44444444444?:invalid=23
whatsapp://template:eeeeeeee@12345/44444444444?:body=
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'whatsapp://eeeeeeee@12345/44444444444'
Notes
WhatsApp Cloud API (whatsapp://): messages to WhatsApp numbers.