UploadSemanticFile
Requests a temporary OSS PUT upload URL. Complete the PUT upload before the URL expires, then pass the returned FileId to the ReferenceFileIds parameter of CreateSemanticJob.
Operation description
Scenarios
Requests an upload slot for a reference file to prepare a file for the singleTableFile source of CreateSemanticJob.
Procedure
Pass the file name, MIME type, and actual size to this operation to obtain
Data.UploadUrlandData.FileId.Perform an HTTP PUT upload with the same
Content-Typebefore theUploadUrlexpires.After the upload is complete, use
FileIdas the only element ofCreateSemanticJob.ReferenceFileIds.
Security considerations
UploadUrl is a short-lived pre-signed PUT URL. The holder can write to the corresponding object. Do not log, share, or persist this URL.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:UploadSemanticFile |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| FileName |
string |
Yes |
The original file name of the reference file to upload. Maximum length: 255 characters. When singleTableFile uses a FileId, only CSV or XLSX files are supported. |
reference.pdf |
| ContentType |
string |
Yes |
The MIME type of the object to upload. Maximum length: 128 characters. This value is included in the UploadUrl signature. Use the same Content-Type when performing the PUT request. |
application/pdf |
| SizeBytes |
integer |
Yes |
The size of the file to upload, in bytes. This value is recorded as attachment metadata. Specify the actual file size. |
1024 |
Construct the request parameters based on the description of each request field.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The standard response for requesting an attachment upload slot. After the PUT upload is complete, Data.FileId can be used as the only file reference in CreateSemanticJob.ReferenceFileIds. |
||
| RequestId |
string |
The request ID. Used for locating logs and troubleshooting issues. |
676271D6-53B4-57BE-89FA-72F7AE1418DF |
| Success |
boolean |
Indicates whether the request was successful. |
|
| Data |
object |
The attachment upload slot information. PUT the file to Data.UploadUrl before Data.ExpiresAt, then use Data.FileId to create a single-file semantic task. |
|
| FileId |
string |
The unique identifier of the attachment. After completing the PUT upload to UploadUrl, pass this value to the ReferenceFileIds parameter of CreateSemanticJob. |
FID1 |
| UploadUrl |
string |
The temporary OSS PUT upload URL. Valid for 30 minutes. Only the specified object can be uploaded. Use the ContentType from the request when performing the PUT request. Do not log or distribute the full URL. |
https://example.com/temporary-upload-url |
| ExpiresAt |
integer |
The expiration time of UploadUrl, expressed as a Unix timestamp in milliseconds. After this time, call UploadSemanticFile again to request a new URL. |
1700001800000 |
For the meaning of response fields and their relationships to subsequent calls, refer to the description of each field.
Examples
Success response
JSON format
{
"RequestId": "676271D6-53B4-57BE-89FA-72F7AE1418DF",
"Success": false,
"Data": {
"FileId": "FID1",
"UploadUrl": "https://example.com/temporary-upload-url",
"ExpiresAt": 1700001800000
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.