This package is a wrapper for MauKirim OpenAPI to send message to whatsapp, you can send plain message, message with button, message with image, and message with document.
You can install the package via composer:
composer require maukirim/open-api
publish configuration file
php artisan vendor:publish --provider="MauKirim\OpenApi\OpenApiServiceProvider"
add to your .env
MAUKIRIM_TOKEN=your_token
to get your token, you can register at maukirim.com or contact us at whatsapp
we can provide free trial for 30 days
Send a plain message to whatsapp
use MauKirim\OpenApi;
$openApi = OpenApi::init(10); // 10 is the number timeout
$openApi->send(
'628xxxxxx',
'Hello World *hii*',
)
send a plain message with button
use MauKirim\OpenApi;
$openApi->send(
'628xxxxxx',
'Hello World *hii*',
[
[
'id' => '1',
'text' => 'Button 1',
'url' => 'your_url',
]
]
)
send a message with image
use MauKirim\OpenApi;
$file = $request->file('image');
$openApi->sendImage(
'628xxxxxx',
'Hello World *hii*',
$file
)
send a message with document
use MauKirim\OpenApi;
$file = $request->file('document');
$openApi->sendDocument(
'628xxxxxx',
'Hello World *hii*',
$file
)
send otp to whatsapp
use MauKirim\OpenApi;
$openApi->sendOTP(
'628xxxxxx'
)
validate otp
use MauKirim\OpenApi;
$openApi->validateOTP(
'628xxxxxx',
'123456'
)
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email info@maukirim.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.