parameter | Enterprise Type | required | Parameter Description |
---|---|---|---|
ctai_doc | jsonString | Yes | Document information object json string, the structure is as follows { "doc_name": "test_name" } must be passed, the file name, the duplicate name will be renamed automatically, the maximum length is 128 characters |
check_only | string | No | Whether to only verify the validity of the parameters without actually uploading the document, the default is 0. 0:No, 1:Yes |
content | file | Yes | The original content stream of the document delivered by the standard form-data file upload method only supports documents with extensions in txt / docx / pdf format.When check_only is 1, this parameter can not be passed. |
Note:is one of the few interfaces that use multipart/form-data to transmit data, and the content of the post must be a form-data structure.
{
"ctdoc_id": "test_id",
"file_url": "https://test_url"
}
parameter | Enterprise Type | Parameter Description |
---|---|---|
ctdoc_id | string | document id |
file_url | string | document URL |
{
"ctai_doc_list": [
{
"doc_type": "url",
"doc_url": "https://test.com/test.html"
},
// other documents info object
]
}
parameter | Enterprise Type | required | Parameter Description |
---|---|---|---|
ctai_doc_list | array | Yes | An array of document information objects, each object in the array is a document information object. |
doc_type | string | Yes | Document type, please pass url, please note that it is not the url address of the document, but the 3-byte string of url. url:Document of type URL. |
doc_url | string | Yes | The URL address of the document.Only URLs of the form http:// or https:// are allowed. |
{
"ctai_doc_result_list": [
{
"ret": "0",
"msg": "",
"ctai_doc": {
"doc_type": "url",
"doc_url": "https://test.com/test.html",
"ctdoc_id": "test_id"
}
}
]
}
parameter | Enterprise Type | Parameter Description |
---|---|---|
ctai_doc_result_list | array | The document adding result list corresponds to the document information object in the incoming ctai_doc_list list. |
ret | string | The error code added in this document, 0 means success |
msg | string | The error message added by this document, or an empty string if successful. |
ctai_doc | object | Document information object. |
doc_type | string | Consistent with the doc_type passed in. |
doc_url | string | Consistent with the incoming doc_url. |
ctdoc_id | string | Document id, this parameter will be included only after the document is successfully added. |
{
"ctdoc_id": "test_id ",
}
parameter | Enterprise Type | required | Parameter Description |
---|---|---|---|
ctdoc_id | string | Yes | The document id to delete, only one document id can be passed at a time. |
No business response parameters, pay attention to whether ret is 0 in the public response parameters
{
"ctdoc_id": "test_id ",
"ctai_doc": {
"doc_name": "test_name",
}
}
parameter | Enterprise Type | required | Parameter Description |
---|---|---|---|
ctdoc_id | string | Yes | The document id to modify, only one document id can be passed at a time. |
ctai_doc | object | Yes | the document info object to modify |
doc_name | string | No | Document name, only documents of the file type support modification of the document name, and the document name cannot be repeated.The maximum length is 128 characters. |
No business response parameters, pay attention to whether ret is 0 in the public response parameters
{
"ctdoc_id": "test_doc_id ",
"doc_type": "doc",
"filter_keywords": "test",
"sort_type": "test_id",
"page": "1",
"page_rows": "10"
}
parameter | Enterprise Type | required | Parameter Description |
---|---|---|---|
ctdoc_id | string | No | Multiple document ids are separated by commas. |
doc_type | string | No | Document types, multiples are separated by commas.optional type: doc:document of type file url:document of type URL |
filter_keywords | string | No | Search keywords, fuzzy search from the document name of the file type document, or the url of the URL type document. |
sort_type | string | No | Sorting method, the default is create_time_asc create_time_asc Sort by creation time from old to new create_time_desc Sort by creation time from new to old |
page | string | No | Paging parameter, the number of pages, starting from 1, the default is 1 |
page_rows | string | No | Pagination parameters, how many items per page, the default is 1 |
{
"total_count": "8",
"ctai_doc_list": [
{
"ctdoc_id": "test_doc_id",
"ctai_doc": {
"doc_type" : "doc",
"doc_url": "http://test.com/a.html",
"doc_name": "test_name",
"process_status": "end_succ",
"process_code": "0" ,
"create_time": "1680010349",
"update_time": "1680010352"
},
// Other document information objects
}
]
}
parameter | Enterprise Type | Parameter Description |
---|---|---|
total_count | string | Total number of documents, used for pagination. |
ctai_doc_list | array | document list |
ctdoc_id | string | document id |
ctai_doc | object | Document Information Object |
doc_type | string | Document type, the values are as follows: doc:document of document type url:document of URL type |
doc_url | string | Only documents of type url are valid.The url address of the URL type document |
doc_name | string | Only documents of type doc are valid.file name |
doc_file_url | string | document download url |
process_status | string | Document processing status, the values are as follows: end_succ:processing complete - success end_fail:processing complete - failure other:in process (generating index, etc.) |
process_code | string | document processing error code, 0 is success If it is not 0, it is a failure. For details, see the error code description in the appendix. |
create_time | string | Creation time, an integer timestamp in seconds |
update_time | string | Last modification time, an integer timestamp in seconds |