PHP code example of aestron / aestron-openapi-sdk

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

    

aestron / aestron-openapi-sdk example snippets



use AestronSdk\Sms\SmsClient;
use AestronSdk\Exception\ClientException;

SmsClient::setAppId('z3i0plp74s22rj');
SmsClient::setCertificate('yRC3vrpUFgpSpw');
try {
    $res = SmsClient::send([
        'to' => '8615826666666',
        'content' => 'Do not go gentle into that good night.',
        'from' => 'BIGO',
        'type' => 'OTP',
        'session' => '168201771',
    ]);
    var_export($res);
} catch (\Exception $e) {
    var_export($e->getMessage());
    var_export(SmsClient::getLastRequestParam());
}