Obtain URL upload information

Updated at:

Use the server-side SDK to call an OpenAPI operation and obtain URL upload information. Sample code in Java is provided.

Sample code

Debug this operation online in the Alibaba Cloud OpenAPI Developer Portal.

<?php

require_once '../vendor/autoload.php';

use AlibabaCloud\SDK\ICE\V20201109\ICE;
use AlibabaCloud\SDK\ICE\V20201109\Models;
use AlibabaCloud\SDK\ICE\V20201109\Models\GetUrlUploadInfosRequest;
use Darabonba\OpenApi\Models\Config;

try {

    // The AccessKey of an Alibaba Cloud account has permissions to access all APIs. Use a Resource Access Management (RAM) user for API access or routine O&M.
    // This example shows how to store your AccessKey ID and AccessKey secret in environment variables. For more information about how to configure them, see: https://help.aliyun.com/document_detail/311677.html
    $credential = new Credential([]);
    $config = new Config([
     'credential' => $credential,
     'endpoint' => 'ice.cn-shanghai.aliyuncs.com'
    ]);
    // To hard-code the AccessKey ID and AccessKey secret, use the following code. However, do not hard-code the AccessKey ID and AccessKey secret in your project code. This may cause an AccessKey leak and threaten the security of all resources in your account.
    // $config->accessKeyId = '<yourAccessKeyId>';
    // $config->accessKeySecret = '<yourAccessKeySecret>';
    $client = new ICE($config);

    $request = new GetUrlUploadInfosRequest();
    $request->uploadURLs = "https://test.com/test.mp4";
    $response = $client->getUrlUploadInfos($request);
    echo json_encode($response->body);

} catch (TeaUnableRetryError $e) {
    var_dump($e->getMessage());
    var_dump($e->getErrorInfo());
    var_dump($e->getLastException());
    var_dump($e->getLastRequest());
}

Related API operation

GetUrlUploadInfos - Obtain URL upload information