Platforms
Sending messages via WhatsApp Business.
Send text messages, media, documents, and template messages via the WhatsApp Cloud API.
Connect
Connect WhatsApp in the OwlStack dashboard:
- Go to Project Settings > Platforms > WhatsApp
- Enter your WhatsApp Business API credentials
- Verify your phone number
- Click Connect
WhatsApp Business
WhatsApp requires a WhatsApp Business account and a verified phone number.
Publishing
use OwlStack\Enums\Platform;
$result = $client->publish($post, [Platform::WhatsApp], [
'to' => '+1234567890',
]);Options
| Option | Type | Description |
|---|---|---|
to | string | Required. Recipient phone number (E.164 format) |
message_type | string | text, image, video, document, template |
template_name | string | Template name (for template messages) |
template_lang | string | Template language code (e.g., en_US) |
preview_url | bool | Show URL preview |
// Text message
$result = $client->publish($post, [Platform::WhatsApp], [
'to' => '+1234567890',
'message_type' => 'text',
'preview_url' => true,
]);
// Template message
$result = $client->publish($post, [Platform::WhatsApp], [
'to' => '+1234567890',
'message_type' => 'template',
'template_name' => 'hello_world',
'template_lang' => 'en_US',
]);Constraints
| Constraint | Value |
|---|---|
| Max text length | 4,096 characters |
| Supported media types | JPEG, PNG, MP4, PDF, DOCX |