PHP code example of yoho / aliyun-sdk

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

    

yoho / aliyun-sdk example snippets




$access_id = "testAccessKeyId";
$access_secret = "testAccessKeySecret";

\aliyun\sdk\Aliyun::auth($access_id,$access_secret);

\aliyun\sdk\Aliyun::region('cn-shanghai');

$response = \aliyun\sdk\vod\Vod::GetCategories()
    ->setCateId(-1)
    ->setPageNo(4)
    ->setPageSize(10)
    ->request();

// Or Request like this
$request = \aliyun\sdk\vod\Vod::GetCategories();
$request->setCateId(-1);
$request->setPageNo(4);
$request->setPageSize(10)
$response = $request->request();

dump($response->getContent());

use aliyun\sdk\vod\request\VodCommon;

class Example extends VodCommon {
    public function doSomething(){
        //setting Action
        $this->setActionName("action_name");
        
        //setting parameter
        $this->setParam("param_name","param_value");
        
        return $this->request();
    }
}