PHP code example of macnie / tsp-sdk

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

    

macnie / tsp-sdk example snippets


use Macnie\Tsp\TspClient;

try{
     $config = [
        'gateway'=>'',
        'token'=>'',
     ];
     $client = new TspClient($config);
     $res = $client->setHost($imei_sn,$host,$port);
     if($res['status'] == 200){
        return true;
     }
}catch(\Excetion $e){
     ......
}

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

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