PHP code example of eiotclub / eiotclub-sdk

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

    

eiotclub / eiotclub-sdk example snippets


use EIOTClub\Sdk\EIOTClub;

$client = EIOTClub::create($appKey, $secret, [
    'base_uri' => 'https://oapi.eiotclub.com',
    'timeout' => 10,
]);

$resp = $client->cards()->getAllCardInfo(pageNum: 1, pageSize: 500);

$resp = $client->cards()->request('/api/v3/card/getCardsInfo', [
    'iccid' => '89860xxxxxx'
]);

$client->packages()->request('/api/v3/package/order', [...]);
$client->pools()->request('/api/v3/pool/list', [...]);
$client->cloudEsim()->request('/api/v3/cloudEsim/list', [...]);
$client->cdr()->request('/api/v3/cdr/query', [...]);

$payload = json_decode(file_get_contents('php://input'), true) ?: [];

if (!$client->verifyNotificationSignature($payload)) {
    http_response_code(401);
    exit('invalid sign');
}