UploadDoc - Upload a document

Updated at:

Uploads a document to Miaodu.

Usage notes

Document upload is asynchronous. After calling this operation, poll getDocInfo to check the document status. Only when the status is 1 can you perform subsequent operations such as 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:UploadDoc

create

*All resources*

None

None

Request parameters

NameTypeRequiredDescriptionExample

WorkspaceId

string

Yes

The unique ID of the Alibaba Cloud Model Studio workspace. For more information, see Workspace ID

llm-yigtrrjl377rcbab

Docs

array<object>

Yes

The document.

object

Yes

The document.

DocName

string

Yes

The document name.

document1.pdf

FileUrl

string

Yes

The file URL.

http://xxx/ccc.pdf

CategoryId

string

No

The directory that contains the document. Default: default.

default

Response parameters

NameTypeDescriptionExample

object

Schema of Response

Code

string

The internal error code.

successful

Data

object

The document information.

DocIds

array

The IDs of documents that were uploaded successfully.

docIds

string

The document ID.

aaaxxx

ExistedIds

array

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

existedIds

string

The document ID.

ccccc

HttpStatusCode

integer

The HTTP status code.

200

Message

string

The error description.

success

RequestId

string

Id of the request

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

Success

boolean

Indicates whether the request succeeded.

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 codeThe error code.The error message.Description

403

NoPermission

You are not authorized to perform this action.

Check the value of workspaceId.

For more error codes, see Error Center.