PHP code example of tongduiba / open-sdk

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

    

tongduiba / open-sdk example snippets

 php
 php
ppKey = 'YOUR_APP_KEY';
$appSecret = 'YOUR_APP_SECRET';

$client = new \Tongduiba\Open\Client($appKey, $appSecret);
$method = '/user/login/auto-login';
$apiVersion = '0.1.0';

$params = ['unionId' => 'Your APP User’s UnionId', 'redirect' => ''];
$response = $client->getUrl($method, $apiVersion, $params);
var_dump($response);
 php
ppKey = 'YOUR_APP_KEY';
$appSecret = 'YOUR_APP_SECRET';
$apiVersion = '0.1.0';

$params = ['unionId' => 'Your APP User’s UnionId', 'memberLevel' => 'To Change Member’s Level'];
$response = $client->get($method, $apiVersion, $params);
var_dump($response);