PHP code example of xjtuana / xjtu-api

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

    

xjtuana / xjtu-api example snippets


use Xjtuana\XjtuApi\Api\ApiNetworkLog;

$networklog = new ApiNetworkLog(
    'API_URL'
);
echo $networklog->getStuByUsername('PPPOE_USERNAME');
echo $networklog->getWenetByUsername('PPPOE_USERNAME');

use Xjtuana\XjtuApi\Api\ApiSms;

$sms = new ApiSms([
    API_URL',
    [
        'accountID' => 'ACCOUNT_ID',
        'accountKey' => 'ACCOUNT_KEY',
        'channelIds' => 'CHANNEL_ID',
    ]
);

var_dump($sms->getChannels());
echo "\n";

var_dump($sms->send(['SMS_TARGET'], 'SMS_CONTENT'));
echo "\n";