CreateKnowledgeObjectUpload
Requests a file upload session and a temporary direct upload URL without creating a knowledge object or starting a build.
Operation description
Creates an upload session for a knowledge object. The tenant and caller identities are determined by the POP authentication context.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:CreateKnowledgeObjectUpload |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| KnowledgeBaseId |
string |
Yes |
The target knowledge base. |
12345678-1234-4234-8234-123456789abc |
| FileName |
string |
Yes |
The original file name. This is not used as the object ID. |
policy.md |
| ContentType |
string |
Yes |
The HTTP media type for the upload. |
text/markdown |
| SizeBytes |
integer |
Yes |
The size of the original file in bytes. The existing maximum size configured for single-file uploads applies, with a default of 100 MiB. If the size exceeds this limit, the InputTooLarge error is returned. |
1024 |
| ContentMd5 |
string |
Yes |
The Base64-encoded MD5 hash of the original file. |
yaNM/IXZgmmMasifdgcavQ== |
| ContentSha256 |
string |
No |
The SHA-256 checksum of the original file. |
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad |
| ClientToken |
string |
No |
The idempotency key for the upload request. |
upload-001 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The unique identifier of the request. You can use this ID to troubleshoot issues. |
00000000-0000-4000-8000-000000000001 |
| Success |
boolean |
Indicates whether the request is successful. |
|
| Data |
object |
The business data returned when the request is successful. |
|
| UploadId |
string |
The identifier of the upload session to be consumed by document creation, model update, or model import tasks. This is not a KnowledgeObjectId or TaskId. |
12345678-1234-4234-8234-123456789abd |
| UploadUrl |
string |
The temporary direct upload URL. |
https://example.invalid/short-lived-upload |
| ExpiresAt |
integer |
The expiration time of the upload URL, represented as a UNIX timestamp in milliseconds. The maximum validity period is 30 minutes, subject to the upper limit of the OSS signature configuration and the remaining session time. Use the value of this field as the actual expiration time. |
1792456200000 |
| RequiredHeaders |
object |
The HTTP headers that must be included in the direct upload request. The key is the actual header name, and the value is the header value. |
|
|
string |
The HTTP headers that must be included in the direct upload request. The key is the actual header name, and the value is the header value. |
text/plain |
|
| Code |
string |
The business error code. You can use this code to determine the error type when the request fails. |
InvalidParameter |
| Message |
string |
The error message returned when the request fails. |
The request parameters are invalid |
Examples
Success response
JSON format
{
"RequestId": "00000000-0000-4000-8000-000000000001",
"Success": false,
"Data": {
"UploadId": "12345678-1234-4234-8234-123456789abd",
"UploadUrl": "https://example.invalid/short-lived-upload",
"ExpiresAt": 1792456200000,
"RequiredHeaders": {
"key": "text/plain"
}
},
"Code": "InvalidParameter",
"Message": "The request parameters are invalid"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The request parameters are invalid. | |
| 400 | UploadIncomplete | The upload or content is invalid. | |
| 400 | InputTooLarge | The upload or content is invalid. | |
| 500 | InternalError | The knowledge base operation failed. Use RequestId to contact support. | |
| 403 | Forbidden | You are not authorized to perform this operation. | |
| 404 | ResourceNotFound | The requested resource does not exist or is not visible. | |
| 409 | Conflict | The resource state conflicts with this operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.