PHP code example of xu5g / bluebird-sdk-php

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

    

xu5g / bluebird-sdk-php example snippets


use liu\tsp\Auth;
use liu\tsp\TspClient;

try{
     $config = [
        'gateway'=>'',
        'secret'=>'',
        'appkey'=>''
     ];
     $auth = new Auth($config);
     $token = $client->getToken();
     //获取到token后将token存储,调用其他接口时作为必传参数传入;
     $client = new TspClient($config);
     $token = $client->getToken();
     $conf = [
        'gateway'=>'',
        'appkey'=>'',
        'token'=>''
     ];
     $client = new TspClient($conf);
     $res = $client->setHost($imei_sn,$host,$port);
     if($res['status'] == 0){
        return true;
     }
}catch(\Excetion $e){
     ......
}

$families = [
    [
        'relation'=>'爷爷',
        'mobile'=>'13533333333'
    ],
    [
        'relation'=>'爸爸',
        'mobile'=>'13533333332'
    ]
];

$client->setFamilies($imei_sn,$families);