PHP code example of maukirim / open-api

1. Go to this page and download the library: Download maukirim/open-api 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/ */

    

maukirim / open-api example snippets


use MauKirim\OpenApi;

$openApi = OpenApi::init(10); // 10 is the number timeout
$openApi->send(
    '628xxxxxx',
    'Hello World *hii*',
)

use MauKirim\OpenApi;
$openApi->send(
    '628xxxxxx',
    'Hello World *hii*',
    [
        [
            'id' => '1',
            'text' => 'Button 1',
            'url' => 'your_url',
        ]
    ]
)

use MauKirim\OpenApi;
$file = $request->file('image');
$openApi->sendImage(
    '628xxxxxx',
    'Hello World *hii*',
    $file
)

use MauKirim\OpenApi;
$file = $request->file('document');
$openApi->sendDocument(
    '628xxxxxx',
    'Hello World *hii*',
    $file
)

use MauKirim\OpenApi;
$openApi->sendOTP(
    '628xxxxxx'
)

use MauKirim\OpenApi;
$openApi->validateOTP(
    '628xxxxxx',
    '123456'
)
bash
php artisan vendor:publish --provider="MauKirim\OpenApi\OpenApiServiceProvider"