PHP code example of stbz-supply / php-sdk

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

    

stbz-supply / php-sdk example snippets

    
    use Stbz\Api\SupplyClient;
    //appkey、appSecret 在开放平台获取 https://open.jxhh.com
    $appKey = "your appkey"; 
    $appSecret = "your appSecret";
    
    try {
    	$supplyClient = new SupplyClient($appKey,$appSecret);
    } catch (OssException $e) {
    	printf(__FUNCTION__ . "creating supplyClient instance: FAILED\n");
    	printf($e->getMessage() . "\n");
    	return null;
    }
    
    //获取商品列表
    $param = ['page'=>1, 'limit'=>20, 'source'=>2];//请求参数
    $method = 'get';//请求方法
    $action = 'v2/Goods/Lists';//请求资源名
    $response = $supplyClient->getApiResponse($method,$action,$param);
bash
$ composer