Retrieves the details of a file by its file ID.
ImportantThis interface is primarily for compatibility with historical scenarios. It is recommended to prioritize the OpenAI-compatible File interface.
Request syntax
GET https://dashscope-intl.aliyuncs.com/api/v1/files/{file_id}
Accept: application/json
Request example
curl --location --request GET "https://dashscope-intl.aliyuncs.com/api/v1/files/123" \
--header "Authorization: Bearer ${DASHSCOPE_API_KEY}"
Request parameters
Parameter | Type | Parameter location | Required | Description |
|---|---|---|---|---|
file_id | String | path | Yes | The file ID. You can obtain this ID from the upload file or list files operations. |
Response example
{
"request_id": "bddee90e-d320-4bf9-b32b-ac3359192d1e",
"data": {
"file_id": "mbSwIGR9yA6i1EtwIpndFErIoDKFyQ6W5601487ECAB111EDA20422ECF4959B5E",
"name": "dogs.jpg",
"description": "1",
"size": 129862,
"md5": "1d5ee55c2453009b14db98e74c453abb",
"gmt_create": "2023-03-25 10:04:11",
"url": "http://xxxxx.oss-cn-hangzhou.aliyuncs.com/oss%3A//dashscope-pre/api-fs/1253/236/dogs.jpg?Expires=1679797621&OSSAccessKeyId=YOUR_ACCESS_KEY_ID&Signature=YOUR_SIGNATURE"
}
}
Response parameters
Parameter | Type | Description |
|---|---|---|
data.file_id | String | The file ID. |
data.url | String | The file download link. |
data.name | String | The file name. |
data.size | Number | The file size. |
data.md5 | String | The MD5 of the file. |
data.description | String | The file description. |
data.gmt_create | Date | The time when the file was uploaded. |
data.id | String | The internal ID of the file. |
data.region | String | The region where the file is stored. |
data.user_id | String | The user ID. |
data.api_key_id | String | The API Key ID. |
request_id | String | The unique ID for the request. It can be used for troubleshooting. |