PHP code example of jushuitan / open-api-sdk

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

    

jushuitan / open-api-sdk example snippets


'components' => [
    'jushuitan' => [
        'class' => 'Jushuitan\OpenSDK\JushuitanComponent',
        'appKey' => 'your-app-key',
        'appSecret' => 'your-app-secret',
    ],
]

// 获取访问令牌
$result = Yii::$app->jushuitan->getAccessToken('authorization-code');

// 刷新访问令牌
$result = Yii::$app->jushuitan->refreshToken('refresh-token');

// 发送API请求
$result = Yii::$app->jushuitan->request('GET', '/open/shops/query', [
    'page_no' => 1,
    'page_size' => 20,
]);

$client = new \Jushuitan\OpenSDK\Client('your-app-key', 'your-app-secret');

// 获取访问令牌
$result = $client->getAccessToken('authorization-code');

// 刷新访问令牌
$result = $client->refreshToken('refresh-token');

// 发送API请求
$result = $client->request('GET', '/open/shops/query', [
    'page_no' => 1,
    'page_size' => 20,
]);