AuthorizeFileUpload
Grants authorization for clients to upload files directly to the specified bucket and object key, and then use the object URL as OssFileUrl to create a parsing task.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dtsai:AuthorizeFileUpload |
create |
*All Resource
|
None |
|
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID, such as cn-beijing. |
cn-beijing |
| AgentName |
string |
No |
The source of the agent or client that initiates the call, such as codex, cursor, or openapi. The maximum length is 32 characters. This parameter is used only for statistics and does not participate in authentication, throttling, quotas, or billing. |
codex |
| FileFormat |
string |
No |
The format of the file to be uploaded. |
|
| BatchSize |
string |
No |
The number of OSS PostObject direct upload authorizations returned in the current request. |
10 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
A30D0930-xxxx-xxxx-xxxx-C2C661CC8B58 |
| Success |
boolean |
Indicates whether the request is successful. |
true |
| HttpStatusCode |
integer |
The business semantic status code. |
200 |
| ErrorCode |
string |
The error code. |
InvalidParameter |
| ErrorMessage |
string |
The error message. |
The parameter [Query] is not valid. |
| AccessKeyId |
string |
The temporary AccessKey ID used for OSS PostObject. |
STS.NV5xxx |
| SecurityToken |
string |
The temporary Security Token Service (STS) token. |
CAISxxx |
| Bucket |
string |
The destination OSS bucket. |
dts-ai-upload-cn-beijing7500163e0eae09 |
| EncodedPolicy |
string |
The Base64-encoded PostObject policy, which includes the object key and file size limit. |
eyJleHBpcmF0aW9uIjo... |
| Endpoint |
string |
OSS Endpoint |
oss-cn-beijing.aliyuncs.com |
| ObjectKey |
string |
The object key that must be used as-is for the upload. |
0a1b_123456_0123456789abcdef0123456789abcdef |
| Signature |
string |
The policy signature. |
masked-signature |
| ExpireTime |
integer |
The expiration time of the OSS PostObject direct upload authorization. |
0 |
| Authorizations |
array<object> |
The list of OSS PostObject direct upload authorizations returned in batch. |
|
|
object |
A single OSS PostObject direct upload authorization. |
||
| ObjectKey |
string |
The object key that must be used as-is for the upload. |
0a1b_123456_0123456789abcdef0123456789abcdef |
| EncodedPolicy |
string |
The Base64-encoded PostObject policy, which includes the object key and file size limit. |
eyJleHBpcmF0aW9uIjo... |
| Signature |
string |
The policy signature. |
masked-signature |
Examples
Success response
JSON format
{
"RequestId": "A30D0930-xxxx-xxxx-xxxx-C2C661CC8B58",
"Success": true,
"HttpStatusCode": 200,
"ErrorCode": "InvalidParameter",
"ErrorMessage": "The parameter [Query] is not valid.",
"AccessKeyId": "STS.NV5xxx",
"SecurityToken": "CAISxxx",
"Bucket": "dts-ai-upload-cn-beijing7500163e0eae09",
"EncodedPolicy": "eyJleHBpcmF0aW9uIjo...",
"Endpoint": "oss-cn-beijing.aliyuncs.com",
"ObjectKey": "0a1b_123456_0123456789abcdef0123456789abcdef",
"Signature": "masked-signature",
"ExpireTime": 0,
"Authorizations": [
{
"ObjectKey": "0a1b_123456_0123456789abcdef0123456789abcdef",
"EncodedPolicy": "eyJleHBpcmF0aW9uIjo...",
"Signature": "masked-signature"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.