FoPost LogoFoPost Docs
Platforms

WhatsApp

Sending messages via WhatsApp Business.

WhatsApp

Send text messages, media, documents, and template messages via the WhatsApp Cloud API.

Connect

Connect WhatsApp in the OwlStack dashboard:

  1. Go to Project Settings > Platforms > WhatsApp
  2. Enter your WhatsApp Business API credentials
  3. Verify your phone number
  4. 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

OptionTypeDescription
tostringRequired. Recipient phone number (E.164 format)
message_typestringtext, image, video, document, template
template_namestringTemplate name (for template messages)
template_langstringTemplate language code (e.g., en_US)
preview_urlboolShow 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

ConstraintValue
Max text length4,096 characters
Supported media typesJPEG, PNG, MP4, PDF, DOCX

On this page