PHP code example of ddxq / mt-openapi-php-sdk

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

    

ddxq / mt-openapi-php-sdk example snippets


php
    composer 

php
    use MtOpenApi\Config\Config;
    use MtOpenApi\Api\ShopService;
    
    //实例化一个配置类
    $config = new Config($app_key, $app_secret, false);
    
    //使用config和token对象,实例化一个服务对象
    $shop_service = new ShopService($token, $config);
    
    //调用服务方法,获取资源
    $shop = $shop_service->->get_shop_ids();