PHP code example of vielhuber / wahelper

1. Go to this page and download the library: Download vielhuber/wahelper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vielhuber / wahelper example snippets



use vielhuber\wahelper\wahelper;

$wahelper = new wahelper();

// fetch messages
$wahelper->fetchMessages(
    device: 'xxxxxxxxxxxx',
    filter: [
        'from' => '491234567890',
        'to' => '491234567890',
        'message' => 'meeting',
        'date_from' => '2026-01-01',
        'date_until' => '2026-12-31'
    ],
    limit: 42,
    order: 'desc'
);

// view a single message by id
$wahelper->viewMessage(
    device: 'xxxxxxxxxxxx',
    id: 'ABCDEF1234567890'
);

// send message to user
$wahelper->sendUser(
    device: 'xxxxxxxxxxxx',
    number: 'xxxxxxxxxxxx',
    message: 'This is a test! 🚀',
    attachments: ['/full/path/to/file.pdf', '/full/path/to/image.png']
);

// send message to group
$wahelper->sendGroup(
    device: 'xxxxxxxxxxxx',
    name: 'Group name',
    message: 'This is a test! 🚀',
    attachments: ['/full/path/to/file.pdf', '/full/path/to/image.png']
);