Documentation Messaging API

Multimedia Messages

Send text, media, location, and interactive messages.

Multimedia Messages

For complete multimedia messages documentation, check the Complete Messages Documentation.

Send Image

Send messages with Images

⚠️ Warning: Make sure the image you send meets WhatsApp requirements:

  • Supported format: JPEG, PNG
  • Maximum recommended size: 5 MB
  • Recommended dimensions: at least 640x640 px
    If the image doesn't meet these requirements, sending may fail.
use ScriptDevelop\WhatsappManager\Facades\Whatsapp;
use ScriptDevelop\WhatsappManager\Models\WhatsappBusinessAccount;
use ScriptDevelop\WhatsappManager\Models\WhatsappPhoneNumber;

$account = WhatsappBusinessAccount::first();
$phone = $account->phoneNumbers->first();

$filePath = storage_path('app/public/laravel-whatsapp-manager.png');
$file = new \SplFileInfo($filePath);

$message = Whatsapp::message()->sendImageMessage(
    $phone->phone_number_id, // Phone number ID
    '57',                        // Country code
    '3237121901',                // Phone number
    $file                       // Image file.
);

Send Audio

Send messages with audio file.

⚠️ Warning: Make sure the audio file you send meets WhatsApp requirements:

  • Supported format: AAC, MP4, MPEG, AMR, OGG.
  • Maximum recommended size: 16 MB
    If the audio file doesn't meet these requirements, sending may fail.
use ScriptDevelop\WhatsappManager\Facades\Whatsapp;
use ScriptDevelop\WhatsappManager\Models\WhatsappBusinessAccount;
use ScriptDevelop\WhatsappManager\Models\WhatsappPhoneNumber;

$account = WhatsappBusinessAccount::first();
$phone = $account->phoneNumbers->first();

$filePath = storage_path('app/public/audio.ogg');
$file = new \SplFileInfo($filePath);

$message = Whatsapp::message()->sendAudioMessage(
    $phone->phone_number_id, // Phone number ID
    '57',                        // Country code
    '3237121901',                // Phone number
    $file                       // Audio file
);

Send Document

Send message with Document

⚠️ Warning: Make sure the document file you send meets WhatsApp requirements:

  • Supported formats: PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT, CSV, ZIP, RAR, among others.
  • Maximum recommended size: 100 MB
    If the file doesn't meet these requirements, sending may fail.
use ScriptDevelop\WhatsappManager\Facades\Whatsapp;
use ScriptDevelop\WhatsappManager\Models\WhatsappBusinessAccount;
use ScriptDevelop\WhatsappManager\Models\WhatsappPhoneNumber;

$account = WhatsappBusinessAccount::first();
$phone = $account->phoneNumbers->first();

$filePath = storage_path('app/public/document.pdf');
$file = new \SplFileInfo($filePath);

$message = Whatsapp::message()->sendDocumentMessage(
    $phone->phone_number_id, // Phone number ID
    '57',                        // Country code
    '3237121901',                // Phone number
    $file                       // Document file
);

Send Video

use ScriptDevelop\WhatsappManager\Facades\Whatsapp;
use ScriptDevelop\WhatsappManager\Models\WhatsappBusinessAccount;
use ScriptDevelop\WhatsappManager\Models\WhatsappPhoneNumber;

// Get account and phone
$account = WhatsappBusinessAccount::first();
$phone = $account->phoneNumbers->first();

// 1. Video from local file with caption
$video = new \SplFileInfo(storage_path('app/public/videos/presentation.mp4'));

Whatsapp::message()->sendVideoMessage(
    $phone->phone_number_id,
    '57',
    '3237121901',
    $video,
    'Watch this video' // Caption
);

πŸ’‘ See More<br />
Check the complete messages documentation for images, videos, audios, documents and stickers.

Share this page