Obtains a new upload credential after the video upload times out.

Usage notes

If you want to overwrite a video or audio source file, you can obtain the upload URL of the source file by calling this operation. Then, you can upload a new source file without changing the video or audio ID. However, the file overwriting may automatically trigger transcoding and snapshot jobs if these jobs are configured. For more information, see Upload URLs and credentials.

QPS limit

You can call this operation up to 120 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. For more information, see QPS limits on API operations in ApsaraVideo VOD.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes RefreshUploadVideo

The operation that you want to perform. Set the value to RefreshUploadVideo.

VideoId String Yes c6a23a870c8c4ffcd40cbd381333****

The ID of the audio or video file. You can use one of the following methods to obtain the ID:

  • Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Media Files > Audio/Video. On the Video and Audio page, you can view the ID of the audio or video file.
  • View the value of the VideoId parameter returned by the CreateUploadVideo operation that you called to upload the audio or video file.
  • View the value of the VideoId parameter returned by the SearchMedia operation that you called to query the ID of the audio or video file after you upload the file.

Response parameters

Parameter Type Example Description
RequestId String 25818875-5F78-4A43-7DF6-D7393642****

The ID of the request.

UploadAddress String eyJTZWN1cml0eVRiQ0FJU3p3TjFxNkZ0NUIyeW****

The upload URL.

Note The upload URL returned by this operation is Base64-encoded. Before you can use an SDK or an API operation to upload a media asset based on the upload URL, you must decode the upload URL by using the Base64 algorithm. You must parse the upload URL only if you use native Object Storage Service (OSS) SDKs or OSS API for uploads.
VideoId String c6a23a870c8c4ffcd40cbd381333****

The ID of the audio or video file.

UploadAuth String FJU3p3TZ0NUIyeW****

The upload credential.

Note The upload credential returned by this operation is Base64-encoded. Before you can use an SDK or an API operation to upload a media asset based on the upload credential, you must decode the upload credential by using the Base64 algorithm. You must parse the upload credential only if you use native OSS SDKs or OSS API for uploads.

Examples

Sample requests

http(s)://vod.cn-shanghai.aliyuncs.com/?Action=RefreshUploadVideo
&VideoId=c6a23a870c8c4ffcd40cbd381333****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<RefreshUploadVideoResponse>
    <RequestId>25818875-5F78-4A43-7DF6-D7393642****</RequestId>
    <UploadAddress>eyJTZWN1cml0eVRiQ0FJU3p3TjFxNkZ0NUIyeW****</UploadAddress>
    <VideoId>c6a23a870c8c4ffcd40cbd381333****</VideoId>
    <UploadAuth>FJU3p3TZ0NUIyeW****</UploadAuth>
</RefreshUploadVideoResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "25818875-5F78-4A43-7DF6-D7393642****",
  "UploadAddress" : "eyJTZWN1cml0eVRiQ0FJU3p3TjFxNkZ0NUIyeW****",
  "VideoId" : "c6a23a870c8c4ffcd40cbd381333****",
  "UploadAuth" : "FJU3p3TZ0NUIyeW****"
}

Error codes

For a list of error codes, visit the API Error Center.

Common errors

The following table describes the common errors that this operation can return.

Error code

Error message

HTTP status code

Description

InvalidVideo.Damaged

The video has been Damaged.

400

The error message returned because an error occurred during the video creation or the video was damaged.

InvalidVideo.NotFound

The video not exist.

404

The error message returned because the video does not exist.

SDK examples

We recommend that you use a server SDK to call this operation. For more information about the sample code that is used to call this operation in various languages, see the following topics: