PHP code example of simboss / sdk

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

    

simboss / sdk example snippets


//初始化client
$simbossClient = SimbossClient::newInstance("appId", "appSecret");

//查询卡详情
$request = new DeviceDetailRequest();
$request->iccid = "89860401101730528432";
$response = $simbossClient->excute($request);

//返回结果说明
//1、接口请求的是否成功 bol
$success = $response->success;
//2、返回码, 见https://www.simboss.com/www/api-doc/index.html, 返回码规范章节。
$code = $response->code;
//3、返回的成功或者错误消息
$message = $response->message;
//4、返回的成功或者错误详细消息
$detail = $response->detail;
//5、返回的数据,不同请求返回值不同,具体请查看API文档。
$data = $response->data;


$conf = [
    'connectionTimeout' => 10000,
    'socketTimeout' => 30000,
    'apiUrl' => 'https://api.simboss.com',
    'apiAppId' => '10242017520',
    'apiAppSecret' => '2aa9382a45d3092f24fe2a0325f28200'
];
//初始化client
$simbossClient = SimbossClient::newInstance(null, null, null, $conf);