PHP code example of cblink / verider-sdk

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

    

cblink / verider-sdk example snippets


use Cblink\Verider\Application;

$config = [
    'open_user_id' => 'your-client-id',
    'open_user_secret' => 'your-client-secret',

    'log' => [
        'name' => 'verider',
    ],
    'http' => [
        'timeout' => 3,
        'base_uri' => 'http://rcloud.verysum.com:8088',
        'http_errors' => false,
        'headers' => [
            'content-type' => 'application/json',
            'accept' => 'application/json',
        ],
    ],
    'cache' => [
        'namespace' => 'verider',
    ],
];

$app = new Application($config);

// 绑定软件到账号下
$app->printer->bindMachine($machine_no, $machine_secret);

// 获取软件下一站挂载的设备,多个软件用「,」分隔
$app->printer->getPrintersByMachineNo($machine_no);

// 创建打印任务
$app->printer->createPrinterTask($device_no, $print_content, $print_id);

// 通过设备号获取设备打印状态
$app->printer->getMachineStatusByMachineCode($device_no);