Skip to content

MauKirim/open-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAPI Wrapper for MauKirim

Latest Version on Packagist Total Downloads

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.

Installation

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

Usage

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'
)

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email info@maukirim.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.