PHP code example of eqxiu / anyun-sdk

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

    

eqxiu / anyun-sdk example snippets




use Eqxiu\Client\AuditClient;

$auditClient = AuditClient::create($appKey, $appSecret, $productKey);
    
try {    
    $ret = $auditClient
        ->setSceneId("1000000")
        ->setTitle("测试")
        ->addTextContent("测试文本")
        ->setCreateUser("linfeng")
        ->setCover("https://res1.eqh5.com/FpA6sMCfreBpDXPbMc_oJvMv4aaO")
        ->addAudioContent("https://res1.eqh5.com/store/5b4629d7a536423f25fe74e99248b5f9.mp3")
        ->addImgContent("https://res1.eqh5.com/FpA6sMCfreBpDXPbMc_oJvMv4aaO")
        ->addVideoContent("https://video-1251586368.file.myqcloud.com//tencent/675a74d31adb9111e050adcae908cced/25e45311345749d69f84cd4f52ae2c03.mp4")
        ->addLinkContent("https://www.baidu.com/")
        ->post();
        
    var_dump($ret);
    if ($ret["code"] == 200) {
        echo $ret . "\n";
    } else {
        var_dump($ret);
    }
} catch (Exception $exception) {
    echo $exception->getMessage() . PHP_EOL;
    echo $exception->getErrorCode(). PHP_EOL;
    echo $exception->getRequestId(). PHP_EOL;
    echo $exception->getErrorMessage(). PHP_EOL;
}