All Products
Search
Document Center

Drive and Photo Service:GetDownloadUrl

Last Updated:Mar 21, 2025

Queries the download URL of a file. For more information about best practices, visit https://help.aliyun.com/document_detail/175889.html.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /v2/file/get_download_url HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request parameters.

share_idstringNo

The share ID. If you want to manage a file by using a sharing link, carry the x-share-token header in the request and specify share_id. In this case, drive_id is invalid. Otherwise, use an AccessKey pair or access token for authentication and specify drive_id. You must specify at least either share_id or drive_id.

7JQX1FswpQ8
drive_idstringNo

The drive ID.

1
file_idstringYes

The file ID.

9520943DC264
file_namestringNo

The name of the file. The name can be up to 1,024 characters in length.

1.txt
expire_secintegerNo

The validity period of the download URL. Maximum value: 115200. Default value: 900. Unit: seconds.

100

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

urlstring

The download URL of a file that is downloaded over the Internet.

https://data.aliyunpds.com/hz22%2F5d79219b0aa9a7c995a94a96993ba3205cd91c5a%2F5d79219bf3261a5d38744da0834ed489b677a27a?Expires=xxxOSSAccessKeyId=xxx&Signature=xxx&response-content-disposition=attachment%3Bfilename%3DtBiZAoJPC2c8b13450eda4292b7f5f8010618e078.txt
internal_urlstring

The download URL of a file that is downloaded over a virtual private cloud (VPC).

https://data-vpc.aliyunpds.com/hz22%2F5d79219b0aa9a7c995a94a96993ba3205cd91c5a%2F5d79219bf3261a5d38744da0834ed489b677a27a?Expires=xxxOSSAccessKeyId=xxx&Signature=xxx&response-content-disposition=attachment%3Bfilename%3DtBiZAoJPC2c8b13450eda4292b7f5f8010618e078.txt
cdn_urlstring

The download URL of a file that is downloaded by using Alibaba Cloud CDN.

https://data-cdn.aliyunpds.com/hz22%2F5d79219b0aa9a7c995a94a96993ba3205cd91c5a%2F5d79219bf3261a5d38744da0834ed489b677a27a?Expires=xxxOSSAccessKeyId=xxx&Signature=xxx&response-content-disposition=attachment%3Bfilename%3DtBiZAoJPC2c8b13450eda4292b7f5f8010618e078.txt
expirationstring

The time when the download URL expires.

2022-01-02T15:04:05.999Z07:00
sizelong

The size of the file. Unit: bytes.

10
crc64_hashstring

The hash value calculated by using 64-bit cyclic redundancy check (CRC-64).

5498595269368962671
content_hashstring

The hash value of the file content.

EA4942AA8761213890A5C386F88E6464D2C31CA1
content_hash_namestring

The name of the algorithm that is used to calculate the hash value of the file content.

sha1

Examples

Sample success responses

JSONformat

{
  "url": "https://data.aliyunpds.com/hz22%2F5d79219b0aa9a7c995a94a96993ba3205cd91c5a%2F5d79219bf3261a5d38744da0834ed489b677a27a?Expires=xxxOSSAccessKeyId=xxx&Signature=xxx&response-content-disposition=attachment%3Bfilename%3DtBiZAoJPC2c8b13450eda4292b7f5f8010618e078.txt",
  "internal_url": "https://data-vpc.aliyunpds.com/hz22%2F5d79219b0aa9a7c995a94a96993ba3205cd91c5a%2F5d79219bf3261a5d38744da0834ed489b677a27a?Expires=xxxOSSAccessKeyId=xxx&Signature=xxx&response-content-disposition=attachment%3Bfilename%3DtBiZAoJPC2c8b13450eda4292b7f5f8010618e078.txt",
  "cdn_url": "https://data-cdn.aliyunpds.com/hz22%2F5d79219b0aa9a7c995a94a96993ba3205cd91c5a%2F5d79219bf3261a5d38744da0834ed489b677a27a?Expires=xxxOSSAccessKeyId=xxx&Signature=xxx&response-content-disposition=attachment%3Bfilename%3DtBiZAoJPC2c8b13450eda4292b7f5f8010618e078.txt",
  "expiration": "2022-01-02T15:04:05.999Z07:00",
  "size": 10,
  "crc64_hash": "5498595269368962671",
  "content_hash": "EA4942AA8761213890A5C386F88E6464D2C31CA1",
  "content_hash_name": "sha1"
}

Error codes

For a list of error codes, visit the Service error codes.