PHP code example of jiguang / jsms

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

    

jiguang / jsms example snippets


use JiGuang\JSMS as JSMS;
...
...

    $client = new JSMS($app_key, $master_secret);

...

$client = new \JiGuang\JSMS($app_key, $master_secret);

// 禁用 SSL 证书的验证,
$client = new JSMS($app_key, $master_secret, [ 'disable_ssl' => true ]);

$client->sendCode($phone, $temp_id, $sign = null);

$client->sendVoiceCode($phone, $options = []);

$client->checkCode($msg_id, $code);

$client->sendMessage($mobile, $temp_id, array $temp_para = [], $time = null, $sign_id = null);

$client->sendBatchMessage($temp_id, array $recipients,$time = null, sign_id = null, $tag = null);

$client->showSchedule($scheduleId);

$client->deleteSchedule($scheduleId);

$client->getAppBalance();

$appKey = 'xxxx';
$masterSecret = 'xxxx';
$phone = 'xxxxxxxxxxx';

$msg_id = 'xxxx';
$code = 'xxxxxx';