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

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

    

yangchangdong / 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();
$xslt
ddxq/mt-openapi-php-sdk 提供的初始代码,在其上进行了一些修改