Overview
This API behaves similarly to the GET method and is compatible with callers who prefer to use the POST method to retrieve file content. Currently, this API is supported only by Alibaba Cloud's Qwen series of models.
API details
Constraints
- The caller must have an API Key. For more information, see Manage AI API Keys.
Request path
POST {BASE_URL}/api/v1/files/{file_id}/content
Request header
Name |
Required |
Example value |
Description |
|---|---|---|---|
| Authorization | Yes | Bearer {token} | Authentication information |
| Content-Type | No | application/json | Request body format |
Request parameters
Path
Name |
Type |
Required |
Example value |
Description |
|---|---|---|---|---|
| file_id | string | Yes | None |
Query
None
Body
None
Response
Response parameters
Name |
Type |
Description |
|---|---|---|
| success | boolean | Whether the request was successful |
| code | string | Response code |
| message | string | Response information |
| data | string | Business response data |
Request example
curl --request POST '{BASE_URL}/api/v1/files/{file_id}/content' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json'
Response example
Successful response
{
"success": true,
"code": "200",
"message": "successful",
"data": "File content string"
}
Unauthorized response
{
"success": false,
"code": "401",
"message": "Unauthorized",
"data": null
}
File not found response
{
"success": false,
"code": "404",
"message": "File not found",
"data": null
}
