DescribeFileUrls.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. require_once __DIR__.'/../../../vendor/autoload.php';
  3. use TencentCloud\Ess\V20201111\EssClient;
  4. use TencentCloud\Ess\V20201111\Models\UserInfo;
  5. use TencentCloud\Ess\V20201111\Models\DescribeFileUrlsRequest;
  6. use TencentCloud\Common\Exception\TencentCloudSDKException;
  7. use TencentCloud\Common\Credential;
  8. use TencentCloud\Common\Profile\ClientProfile;
  9. use TencentCloud\Common\Profile\HttpProfile;
  10. try {
  11. // 实例化一个证书对象,入参需要传入腾讯云账户secretId,secretKey
  12. $cred = new Credential("********************************", "********************************");
  13. // 实例化一个http选项,可选的,没有特殊需求可以跳过
  14. $httpProfile = new HttpProfile();
  15. $httpProfile->setReqMethod("POST"); // post请求(默认为post请求)
  16. $httpProfile->setReqTimeout(30); // 请求超时时间,单位为秒(默认60秒)
  17. $httpProfile->setEndpoint("ess.tencentcloudapi.com"); // 指定接入地域域名(默认就近接入)
  18. // 实例化一个client选项,可选的,没有特殊需求可以跳过
  19. $clientProfile = new ClientProfile();
  20. $clientProfile->setSignMethod("TC3-HMAC-SHA256"); // 指定签名算法(默认为HmacSHA256)
  21. $clientProfile->setHttpProfile($httpProfile);
  22. $client = new EssClient($cred, "ap-guangzhou", $clientProfile);
  23. $req = new DescribeFileUrlsRequest();
  24. $userInfo = new UserInfo();
  25. $userInfo->setUserId("********************************");
  26. $req->setOperator($userInfo);
  27. $req->setBusinessType("FLOW");
  28. $req->BusinessIds = [];
  29. array_push($req->BusinessIds, "********************************");
  30. $resp = $client->DescribeFileUrls($req);
  31. // 输出json格式的字符串回包
  32. print_r($resp->toJsonString());
  33. }
  34. catch(TencentCloudSDKException $e) {
  35. echo $e;
  36. }