Skip to content

Send Text Status

Send a text status message on WhatsApp.

Usage

php
use NjoguAmos\Waha\Facades\Status;
use NjoguAmos\Waha\Dto\TextStatusData;

$data = new TextStatusData(
    text: 'Hello from WhatsApp!',
    backgroundColor: '#38b42f',
    font: 1
);

$result = Status::sendText(session: 'default', data: $data);

With Contacts

php
use NjoguAmos\Waha\Facades\Status;
use NjoguAmos\Waha\Dto\TextStatusData;

$data = new TextStatusData(
    text: 'Hello from WhatsApp!',
    backgroundColor: '#38b42f',
    font: 1,
    contacts: ['[email protected]', '[email protected]']
);

$result = Status::sendText(session: 'default', data: $data);

Result

The response is an instance of NjoguAmos\Waha\Dto\TextStatusData.

php
$result->text;            // "Hello from WhatsApp!"
$result->backgroundColor; // "#38b42f"
$result->font;            // 1
$result->contacts;        // ["[email protected]", ...] or null

Parameters

ParameterTypeRequiredDescription
textstringYesThe status message text
backgroundColorstringYesBackground color in hex format (e.g., #38b42f)
fontintYesFont style (1-5)
contactsarray|nullNoArray of chat IDs to send status to

Released under the MIT License.