Obtain URL upload information

更新时间:
复制 MD 格式

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 API online in the Alibaba Cloud OpenAPI Developer Portal.

import OpenApi, * as $OpenApi from '@alicloud/openapi-client';
import Credential, { Config } from '@alicloud/credentials';
const Client = require('@alicloud/ice20201109').default;

// An AccessKey of an Alibaba Cloud account has full access permissions to all APIs. We recommend that you use a Resource Access Management (RAM) user to call APIs or perform daily operations and maintenance (O&M).
// This example shows how to store an AccessKey ID and an AccessKey secret in an environment variable. For more information about the configuration, see https://help.aliyun.com/document_detail/378664.html

const cred = new Credential();
const iceClient = new Client(new $OpenApi.Config({
  credential: cred,
  endpoint: 'ice.cn-shanghai.aliyuncs.com'
}));

// To hard-code the AccessKey ID and AccessKey secret, use the following code. However, we strongly recommend that you do not hard-code the AccessKey ID and AccessKey secret in your project code. Hard coding may cause the AccessKey to be leaked, which threatens the security of all your resources.
// const iceClient = new Client(new $OpenApi.Config({
//   accessKeyId: '<yourAccessKeyId>',
//   accessKeySecret: '<yourAccessKeySecret>',
//   endpoint: 'ice.cn-shanghai.aliyuncs.com'
// }));

// Obtain URL upload information
var jobId = "bde1a55c98694bf3bd2e01a68694****";
iceClient.getUrlUploadInfos({
    jobIds: jobId
}).then(function (data) {
    console.log(data.body);
}, function (err) {
    console.log('Error:' + err);
});

Related API operation

GetUrlUploadInfos - Obtain URL upload information