All Products
Search
Document Center

Drive and Photo Service:GetDownloadUrl

Last Updated:Mar 20, 2026

Retrieves the download URL for a file.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /v2/file/get_download_url HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

share_id

string

No

The share ID. If you access the file through a share, include the `x-share-token` header for authentication and provide this field. In that case, the `drive_id` field is ignored. Otherwise, use an AccessKey pair or an access token for authentication and provide the `drive_id` field. You must specify either `share_id` or `drive_id`.

7JQX1FswpQ8

drive_id

string

No

The drive ID.

1

file_id

string

Yes

The file ID.

9520943DC264

file_name

string

No

The file name. The maximum length is 1,024 characters.

1.txt

expire_sec

integer

No

The time-to-live (TTL) of the download URL, in seconds. The maximum value is 115200. The default value is 900.

100

response_content_type

string

No

video/mp4

Response elements

Element

Type

Description

Example

object

The response schema.

url

string

The public download URL. If you enable intelligent data endpoints, the system selects the best network line for the customer and returns a download URL with the corresponding domain name.

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

internal_url

string

The download URL for use within a Virtual Private Cloud (VPC). This field is not used if you enable intelligent data endpoints. In that case, the system automatically returns the appropriate URL in the url field. To use this field, contact PDS technical support.

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

cdn_url

string

The Content Delivery Network (CDN) download URL. This field is not used if you enable intelligent data endpoints. In that case, the system automatically returns the appropriate URL in the url field. To use this field, contact PDS technical support.

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

expiration

string

The expiration time of the download URL.

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

size

integer

The file size, in bytes.

10

crc64_hash

string

The CRC-64 value.

5498595269368962671

content_hash

string

The hash of the file content.

EA4942AA8761213890A5C386F88E6464D2C31CA1

content_hash_name

string

The name of the hash algorithm for the file content.

sha1

Examples

Success response

JSON format

{
  "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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.