Skip to main content

UploadDoc - Upload a document

Uploads a document to Miaodu.

Usage notes

Document upload is asynchronous. After calling this operation, you must call the getDocInfo operation in a loop to check the document status. Only when the document status is 1 can you perform subsequent operations such as document summarization, generating a mind map for the full text, summarizing questions and answers, extracting keywords, or rewriting.

Try it out

You can call this operation in OpenAPI Explorer without calculating a signature. After a successful call, OpenAPI Explorer can automatically generate SDK code examples. Try it out

Authorization information

The following table describes the authorization information for this API operation. You can use this information in the Action element of a RAM policy statement to grant a RAM user or RAM role permission to call the operation. The columns are described as follows:
  • Action: a specific permission.
  • Access level: the access level of an action. Valid values: Write, Read, and List.
  • Resource type: the types of resources for which the action supports authorization:
    • Required resource types are marked with an asterisk (*).
    • Actions that do not support resource-level authorization use All resources.
  • Condition key: a condition key defined by the cloud service.
  • Dependent action: an additional permission required to perform the action. The caller must also have permission to perform the dependent action.
ActionAccess levelResource typeCondition keyDependent action
aimiaobi:UploadDoccreate
*All resources
*
    None
None

Request parameters

NameTypeRequiredDescriptionExample
WorkspaceIdstringYes

The unique ID of the Alibaba Cloud Model Studio workspace: obtain the Workspace ID

llm-yigtrrjl377rcbab
Docsarray<object>Yes

Document

objectYes

Document

DocNamestringYes

The document name

document1.pdf
FileUrlstringYes

The file URL

http://xxx/ccc.pdf
CategoryIdstringNo

The directory where the document resides. If you leave this parameter empty, the value is default

default

Response parameters

NameTypeDescriptionExample
object

Schema of Response

Codestring

The internal error code

successful
Dataobject

The document information

DocIdsarray

The IDs of documents that were uploaded successfully

docIdsstring

The document ID

aaaxxx
ExistedIdsarray

The IDs of documents that could not be uploaded because they already exist

existedIdsstring

The document ID

ccccc
HttpStatusCodeinteger

The HTTP status code

200
Messagestring

The error description

success
RequestIdstring

Id of the request

1813ceee-7fe5-41b4-87e5-982a4d18cca5
Successboolean

Indicates whether the request is successful

true

Examples

Sample success response JSON format
{
  "Code": "successful",
  "Data": {
    "DocIds": [
      "aaaxxx"
    ],
    "ExistedIds": [
      "ccccc"
    ]
  },
  "HttpStatusCode": 200,
  "Message": "success",
  "RequestId": "1813ceee-7fe5-41b4-87e5-982a4d18cca5",
  "Success": true
}

Error codes

HTTP status codeError codeError messageDescription
403NoPermissionYou are not authorized to perform this action.Check the value of workspaceId
For more error codes, visit the Error Center.