You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  1. ---
  2. sidebar_class_name: hidden
  3. ---
  4. # API reference
  5. RAGFlow offers RESTful APIs for you to integrate its capabilities into third-party applications.
  6. ## Base URL
  7. ```
  8. http://<host_address>/v1/api/
  9. ```
  10. ## Dataset URL
  11. ```
  12. http://<host_address>/api/v1/dataset
  13. ```
  14. ## Authorization
  15. All of RAGFlow's RESTFul APIs use API key for authorization, so keep it safe and do not expose it to the front end.
  16. Put your API key in the request header.
  17. ```buildoutcfg
  18. Authorization: Bearer {API_KEY}
  19. ```
  20. To get your API key:
  21. 1. In RAGFlow, click **Chat** tab in the middle top of the page.
  22. 2. Hover over the corresponding dialogue **>** **Chat Bot API** to show the chatbot API configuration page.
  23. 3. Click **Api Key** **>** **Create new key** to create your API key.
  24. 4. Copy and keep your API key safe.
  25. ## Create dataset
  26. This method creates (news) a dataset for a specific user.
  27. ### Request
  28. #### Request URI
  29. | Method | Request URI |
  30. |--------|-------------|
  31. | POST | `/dataset` |
  32. :::note
  33. You are *required* to save the `data.dataset_id` value returned in the response data, which is the session ID for all upcoming conversations.
  34. :::
  35. #### Request parameter
  36. | Name | Type | Required | Description |
  37. |----------------|--------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  38. | `dataset_name` | string | Yes | The unique identifier assigned to each newly created dataset. `dataset_name` must be less than 2 ** 10 characters and cannot be empty. The following character sets are supported: <br />- 26 lowercase English letters (a-z)<br />- 26 uppercase English letters (A-Z)<br />- 10 digits (0-9)<br />- "_", "-", "." |
  39. ### Response
  40. ```json
  41. {
  42. "code": 0,
  43. "data": {
  44. "dataset_name": "kb1",
  45. "dataset_id": "375e8ada2d3c11ef98f93043d7ee537e"
  46. },
  47. "message": "success"
  48. }
  49. ```
  50. ## Get dataset list
  51. This method lists the created datasets for a specific user.
  52. ### Request
  53. #### Request URI
  54. | Method | Request URI |
  55. |----------|-------------|
  56. | GET | `/dataset` |
  57. ### Response
  58. #### Response parameter
  59. ```json
  60. {
  61. "code": 0,
  62. "data": [
  63. {
  64. "avatar": null,
  65. "chunk_num": 0,
  66. "create_date": "Mon, 17 Jun 2024 16:00:05 GMT",
  67. "create_time": 1718611205876,
  68. "created_by": "b48110a0286411ef994a3043d7ee537e",
  69. "description": null,
  70. "doc_num": 0,
  71. "embd_id": "BAAI/bge-large-zh-v1.5",
  72. "id": "9bd6424a2c7f11ef81b83043d7ee537e",
  73. "language": "Chinese",
  74. "name": "dataset3(23)",
  75. "parser_config": {
  76. "pages": [
  77. [
  78. 1,
  79. 1000000
  80. ]
  81. ]
  82. },
  83. "parser_id": "naive",
  84. "permission": "me",
  85. "similarity_threshold": 0.2,
  86. "status": "1",
  87. "tenant_id": "b48110a0286411ef994a3043d7ee537e",
  88. "token_num": 0,
  89. "update_date": "Mon, 17 Jun 2024 16:00:05 GMT",
  90. "update_time": 1718611205876,
  91. "vector_similarity_weight": 0.3
  92. }
  93. ],
  94. "message": "List datasets successfully!"
  95. }
  96. ```
  97. ## Delete dataset
  98. This method deletes a dataset for a specific user.
  99. ### Request
  100. #### Request URI
  101. | Method | Request URI |
  102. |--------|-------------------------|
  103. | DELETE | `/dataset/{dataset_id}` |
  104. #### Request parameter
  105. | Name | Type | Required | Description |
  106. |--------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  107. | `dataset_id` | string | Yes | The ID of the dataset. Call ['GET' /dataset](#create-dataset) to retrieve the ID. |
  108. ### Response
  109. ```json
  110. {
  111. "code": 0,
  112. "message": "Remove dataset: 9cefaefc2e2611ef916b3043d7ee537e successfully"
  113. }
  114. ```
  115. ### Get the details of the specific dataset
  116. This method gets the details of the specific dataset.
  117. ### Request
  118. #### Request URI
  119. | Method | Request URI |
  120. |----------|-------------------------|
  121. | GET | `/dataset/{dataset_id}` |
  122. #### Request parameter
  123. | Name | Type | Required | Description |
  124. |--------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
  125. | `dataset_id` | string | Yes | The ID of the dataset. Call ['GET' /dataset](#create-dataset) to retrieve the ID. |
  126. ### Response
  127. ```json
  128. {
  129. "code": 0,
  130. "data": {
  131. "avatar": null,
  132. "chunk_num": 0,
  133. "description": null,
  134. "doc_num": 0,
  135. "embd_id": "BAAI/bge-large-zh-v1.5",
  136. "id": "060323022e3511efa8263043d7ee537e",
  137. "language": "Chinese",
  138. "name": "test(1)",
  139. "parser_config":
  140. {
  141. "pages": [[1, 1000000]]
  142. },
  143. "parser_id": "naive",
  144. "permission": "me",
  145. "token_num": 0
  146. },
  147. "message": "success"
  148. }
  149. ```
  150. ### Update the details of the specific dataset
  151. This method updates the details of the specific dataset.
  152. ### Request
  153. #### Request URI
  154. | Method | Request URI |
  155. |--------|-------------------------|
  156. | PUT | `/dataset/{dataset_id}` |
  157. #### Request parameter
  158. You are required to input at least one parameter.
  159. | Name | Type | Required | Description |
  160. |----------------------|--------|----------|-----------------------------------------------------------------------|
  161. | `name` | string | No | The name of the knowledge base, from which you get the document list. |
  162. | `description` | string | No | The description of the knowledge base. |
  163. | `permission` | string | No | The permission for the knowledge base, default:me. |
  164. | `language` | string | No | The language of the knowledge base. |
  165. | `chunk_method` | string | No | The chunk method of the knowledge base. |
  166. | `embedding_model_id` | string | No | The embedding model id of the knowledge base. |
  167. | `photo` | string | No | The photo of the knowledge base. |
  168. | `layout_recognize` | bool | No | The layout recognize of the knowledge base. |
  169. | `token_num` | int | No | The token number of the knowledge base. |
  170. | `id` | string | No | The id of the knowledge base. |
  171. ### Response
  172. ### Successful response
  173. ```json
  174. {
  175. "code": 0,
  176. "data": {
  177. "avatar": null,
  178. "chunk_num": 0,
  179. "create_date": "Wed, 19 Jun 2024 20:33:34 GMT",
  180. "create_time": 1718800414518,
  181. "created_by": "b48110a0286411ef994a3043d7ee537e",
  182. "description": "new_description1",
  183. "doc_num": 0,
  184. "embd_id": "BAAI/bge-large-zh-v1.5",
  185. "id": "24f9f17a2e3811ef820e3043d7ee537e",
  186. "language": "English",
  187. "name": "new_name",
  188. "parser_config":
  189. {
  190. "pages": [[1, 1000000]]
  191. },
  192. "parser_id": "naive",
  193. "permission": "me",
  194. "similarity_threshold": 0.2,
  195. "status": "1",
  196. "tenant_id": "b48110a0286411ef994a3043d7ee537e",
  197. "token_num": 0,
  198. "update_date": "Wed, 19 Jun 2024 20:33:34 GMT",
  199. "update_time": 1718800414529,
  200. "vector_similarity_weight": 0.3
  201. },
  202. "message": "success"
  203. }
  204. ```
  205. ### Response for the operating error
  206. ```json
  207. {
  208. "code": 103,
  209. "message": "Only the owner of knowledgebase is authorized for this operation!"
  210. }
  211. ```
  212. ### Response for no parameter
  213. ```json
  214. {
  215. "code": 102,
  216. "message": "Please input at least one parameter that you want to update!"
  217. }
  218. ```
  219. ------------------------------------------------------------------------------------------------------------------------------
  220. ## Upload documents
  221. This method uploads documents for a specific user.
  222. ### Request
  223. #### Request URI
  224. | Method | Request URI |
  225. |--------|-----------------------------------|
  226. | POST | `/dataset/{dataset_id}/documents` |
  227. #### Request parameter
  228. | Name | Type | Required | Description |
  229. |--------------|--------|----------|------------------------------------------------------------|
  230. | `dataset_id` | string | Yes | The ID of the dataset. Call ['GET' /dataset](#create-dataset) to retrieve the ID. |
  231. ### Response
  232. ### Successful response
  233. ```json
  234. {
  235. "code": 0,
  236. "data": [
  237. {
  238. "created_by": "b48110a0286411ef994a3043d7ee537e",
  239. "id": "859584a0379211efb1a23043d7ee537e",
  240. "kb_id": "8591349a379211ef92213043d7ee537e",
  241. "location": "test.txt",
  242. "name": "test.txt",
  243. "parser_config": {
  244. "pages": [
  245. [1, 1000000]
  246. ]
  247. },
  248. "parser_id": "naive",
  249. "size": 0,
  250. "thumbnail": null,
  251. "type": "doc"
  252. },
  253. {
  254. "created_by": "b48110a0286411ef994a3043d7ee537e",
  255. "id": "8596f18c379211efb1a23043d7ee537e",
  256. "kb_id": "8591349a379211ef92213043d7ee537e",
  257. "location": "test1.txt",
  258. "name": "test1.txt",
  259. "parser_config": {
  260. "pages": [
  261. [1, 1000000]
  262. ]
  263. },
  264. "parser_id": "naive",
  265. "size": 0,
  266. "thumbnail": null,
  267. "type": "doc"
  268. }
  269. ],
  270. "message": "success"
  271. }
  272. ```
  273. ### Response for nonexistent files
  274. ```json
  275. {
  276. "code": "RetCode.DATA_ERROR",
  277. "message": "The file test_data/imagination.txt does not exist"
  278. }
  279. ```
  280. ### Response for nonexistent dataset
  281. ```json
  282. {
  283. "code": 102,
  284. "message": "Can't find this dataset"
  285. }
  286. ```
  287. ### Response for the number of files exceeding the limit
  288. ```json
  289. {
  290. "code": 102,
  291. "message": "You try to upload 512 files, which exceeds the maximum number of uploading files: 256"
  292. }
  293. ```
  294. ### Response for uploading without files.
  295. ```json
  296. {
  297. "code": 101,
  298. "message": "None is not string."
  299. }
  300. ```
  301. ## Delete documents
  302. This method deletes documents for a specific user.
  303. ### Request
  304. #### Request URI
  305. | Method | Request URI |
  306. |--------|-----------------------------------|
  307. | DELETE | `/dataset/{dataset_id}/documents/{document_id}` |
  308. #### Request parameter
  309. | Name | Type | Required | Description |
  310. |---------------|--------|----------|-------------------------------------------------------------------------------------|
  311. | `dataset_id` | string | Yes | The ID of the dataset. Call ['GET' /dataset](#create-dataset) to retrieve the ID. |
  312. | `document_id` | string | Yes | The ID of the document. Call ['GET' /document](#list-documents) to retrieve the ID. |
  313. ### Response
  314. ### Successful response
  315. ```json
  316. {
  317. "code": 0,
  318. "data": true,
  319. "message": "success"
  320. }
  321. ```
  322. ### Response for deleting a document that does not exist
  323. ```json
  324. {
  325. "code": 102,
  326. "message": "Document 111 not found!"
  327. }
  328. ```
  329. ### Response for deleting documents from a non-existent dataset
  330. ```json
  331. {
  332. "code": 101,
  333. "message": "The document f7aba1ec379b11ef8e853043d7ee537e is not in the dataset: 000, but in the dataset: f7a7ccf2379b11ef83223043d7ee537e."
  334. }
  335. ```
  336. ## List documents
  337. This method lists documents for a specific user.
  338. ### Request
  339. #### Request URI
  340. | Method | Request URI |
  341. |--------|-----------------------------------|
  342. | GET | `/dataset/{dataset_id}/documents` |
  343. #### Request parameter
  344. | Name | Type | Required | Description |
  345. |--------------|--------|----------|------------------------------------------------------------------------------------------------------------|
  346. | `dataset_id` | string | Yes | The ID of the dataset. Call ['GET' /dataset](#create-dataset) to retrieve the ID. |
  347. | `offset` | int | No | The start of the listed documents. Default: 0 |
  348. | `count` | int | No | The total count of the listed documents. Default: -1, meaning all the later part of documents from the start. |
  349. | `order_by` | string | No | Default: `create_time` |
  350. | `descend` | bool | No | The order of listing documents. Default: True |
  351. | `keywords` | string | No | The searching keywords of listing documents. Default: "" |
  352. ### Response
  353. ### Successful Response
  354. ```json
  355. {
  356. "code": 0,
  357. "data": {
  358. "docs": [
  359. {
  360. "chunk_num": 0,
  361. "create_date": "Mon, 01 Jul 2024 19:24:10 GMT",
  362. "create_time": 1719833050046,
  363. "created_by": "b48110a0286411ef994a3043d7ee537e",
  364. "id": "6fb6f588379c11ef87023043d7ee537e",
  365. "kb_id": "6fb1c9e6379c11efa3523043d7ee537e",
  366. "location": "empty.txt",
  367. "name": "empty.txt",
  368. "parser_config": {
  369. "pages": [
  370. [1, 1000000]
  371. ]
  372. },
  373. "parser_id": "naive",
  374. "process_begin_at": null,
  375. "process_duation": 0.0,
  376. "progress": 0.0,
  377. "progress_msg": "",
  378. "run": "0",
  379. "size": 0,
  380. "source_type": "local",
  381. "status": "1",
  382. "thumbnail": null,
  383. "token_num": 0,
  384. "type": "doc",
  385. "update_date": "Mon, 01 Jul 2024 19:24:10 GMT",
  386. "update_time": 1719833050046
  387. },
  388. {
  389. "chunk_num": 0,
  390. "create_date": "Mon, 01 Jul 2024 19:24:10 GMT",
  391. "create_time": 1719833050037,
  392. "created_by": "b48110a0286411ef994a3043d7ee537e",
  393. "id": "6fb59c60379c11ef87023043d7ee537e",
  394. "kb_id": "6fb1c9e6379c11efa3523043d7ee537e",
  395. "location": "test.txt",
  396. "name": "test.txt",
  397. "parser_config": {
  398. "pages": [
  399. [1, 1000000]
  400. ]
  401. },
  402. "parser_id": "naive",
  403. "process_begin_at": null,
  404. "process_duation": 0.0,
  405. "progress": 0.0,
  406. "progress_msg": "",
  407. "run": "0",
  408. "size": 0,
  409. "source_type": "local",
  410. "status": "1",
  411. "thumbnail": null,
  412. "token_num": 0,
  413. "type": "doc",
  414. "update_date": "Mon, 01 Jul 2024 19:24:10 GMT",
  415. "update_time": 1719833050037
  416. }
  417. ],
  418. "total": 2
  419. },
  420. "message": "success"
  421. }
  422. ```
  423. ### Response for listing documents with IndexError
  424. ```json
  425. {
  426. "code": 100,
  427. "message": "IndexError('Offset is out of the valid range.')"
  428. }
  429. ```
  430. ## Update the details of the document
  431. This method updates the details, including the name, enable and template type of a specific document for a specific user.
  432. ### Request
  433. #### Request URI
  434. | Method | Request URI |
  435. |--------|-------------------------------------------------|
  436. | PUT | `/dataset/{dataset_id}/documents/{document_id}` |
  437. #### Request parameter
  438. | Name | Type | Required | Description |
  439. |--------------|--------|----------|------------------------------------------------------------------------------------------------------------|
  440. | `dataset_id` | string | Yes | The ID of the dataset. Call ['GET' /dataset](#create-dataset) to retrieve the ID. |
  441. | `document_id` | string | Yes | The ID of the document. Call ['GET' /document](#list-documents) to retrieve the ID. |
  442. ### Response
  443. ### Successful Response
  444. ```json
  445. {
  446. "code": 0,
  447. "data": {
  448. "chunk_num": 0,
  449. "create_date": "Mon, 15 Jul 2024 16:55:03 GMT",
  450. "create_time": 1721033703914,
  451. "created_by": "b48110a0286411ef994a3043d7ee537e",
  452. "id": "ed30167a428711efab193043d7ee537e",
  453. "kb_id": "ed2d8770428711efaf583043d7ee537e",
  454. "location": "test.txt",
  455. "name": "new_name.txt",
  456. "parser_config": {
  457. "pages": [
  458. [1, 1000000]
  459. ]
  460. },
  461. "parser_id": "naive",
  462. "process_begin_at": null,
  463. "process_duration": 0.0,
  464. "progress": 0.0,
  465. "progress_msg": "",
  466. "run": "0",
  467. "size": 14,
  468. "source_type": "local",
  469. "status": "1",
  470. "thumbnail": null,
  471. "token_num": 0,
  472. "type": "doc",
  473. "update_date": "Mon, 15 Jul 2024 16:55:03 GMT",
  474. "update_time": 1721033703934
  475. },
  476. "message": "Success"
  477. }
  478. ```
  479. ### Response for updating a document which does not exist.
  480. ```json
  481. {
  482. "code": 101,
  483. "message": "This document weird_doc_id cannot be found!"
  484. }
  485. ```
  486. ### Response for updating a document without giving parameters.
  487. ```json
  488. {
  489. "code": 102,
  490. "message": "Please input at least one parameter that you want to update!"
  491. }
  492. ```
  493. ### Response for updating a document in the nonexistent dataset.
  494. ```json
  495. {
  496. "code": 102,
  497. "message": "This dataset fake_dataset_id cannot be found!"
  498. }
  499. ```
  500. ### Response for updating a document with an extension name that differs from its original.
  501. ```json
  502. {
  503. "code": 101,
  504. "data": false,
  505. "message": "The extension of file cannot be changed"
  506. }
  507. ```
  508. ### Response for updating a document with a duplicate name.
  509. ```json
  510. {
  511. "code": 101,
  512. "message": "Duplicated document name in the same dataset."
  513. }
  514. ```
  515. ### Response for updating a document's illegal parameter.
  516. ```json
  517. {
  518. "code": 101,
  519. "message": "illegal_parameter is an illegal parameter."
  520. }
  521. ```
  522. ### Response for updating a document's name without its name value.
  523. ```json
  524. {
  525. "code": 102,
  526. "message": "There is no new name."
  527. }
  528. ```
  529. ### Response for updating a document's with giving illegal enable's value.
  530. ```json
  531. {
  532. "code": 102,
  533. "message": "Illegal value '?' for 'enable' field."
  534. }
  535. ```
  536. ## Download the document
  537. This method downloads a specific document for a specific user.
  538. ### Request
  539. #### Request URI
  540. | Method | Request URI |
  541. |--------|-------------------------------------------------|
  542. | GET | `/dataset/{dataset_id}/documents/{document_id}` |
  543. #### Request parameter
  544. | Name | Type | Required | Description |
  545. |--------------|--------|----------|------------------------------------------------------------------------------------------------------------|
  546. | `dataset_id` | string | Yes | The ID of the dataset. Call ['GET' /dataset](#create-dataset) to retrieve the ID. |
  547. | `document_id` | string | Yes | The ID of the document. Call ['GET' /document](#list-documents) to retrieve the ID. |
  548. ### Response
  549. ### Successful Response
  550. ```json
  551. {
  552. "code": "0",
  553. "data": "b'test\\ntest\\ntest'"
  554. }
  555. ```
  556. ### Response for downloading a document which does not exist.
  557. ```json
  558. {
  559. "code": 101,
  560. "message": "This document 'imagination.txt' cannot be found!"
  561. }
  562. ```
  563. ### Response for downloading a document in the nonexistent dataset.
  564. ```json
  565. {
  566. "code": 102,
  567. "message": "This dataset 'imagination' cannot be found!"
  568. }
  569. ```
  570. ### Response for downloading an empty document.
  571. ```json
  572. {
  573. "code": 102,
  574. "message": "This file is empty."
  575. }
  576. ```
  577. ## Start parsing a document
  578. This method enables a specific document to start parsing for a specific user.
  579. ### Request
  580. #### Request URI
  581. | Method | Request URI |
  582. |--------|--------------------------------------------------------|
  583. | POST | `/dataset/{dataset_id}/documents/{document_id}/status` |
  584. #### Request parameter
  585. | Name | Type | Required | Description |
  586. |--------------|--------|----------|------------------------------------------------------------------------------------------------------------|
  587. | `dataset_id` | string | Yes | The ID of the dataset. Call ['GET' /dataset](#create-dataset) to retrieve the ID. |
  588. | `document_id` | string | Yes | The ID of the document. Call ['GET' /document](#list-documents) to retrieve the ID. |
  589. ### Response
  590. ### Successful Response
  591. ```json
  592. {
  593. "code": 0,
  594. "message": ""
  595. }
  596. ```
  597. ### Response for parsing a document which does not exist.
  598. ```json
  599. {
  600. "code": 101,
  601. "message": "This document 'imagination.txt' cannot be found!"
  602. }
  603. ```
  604. ### Response for parsing a document in the nonexistent dataset.
  605. ```json
  606. {
  607. "code": 102,
  608. "message": "This dataset 'imagination.txt' cannot be found!"
  609. }
  610. ```
  611. ### Response for parsing an empty document.
  612. ```json
  613. {
  614. "code": 0,
  615. "message": "Empty data in the document: empty.txt;"
  616. }
  617. ```
  618. ## Start parsing multiple documents
  619. This method enables multiple documents, including all documents in the specific dataset or specified documents, to start parsing for a specific user.
  620. ### Request
  621. #### Request URI
  622. | Method | Request URI |
  623. |--------|-------------------------------------------------------|
  624. | POST | `/dataset/{dataset_id}/documents/status` |
  625. #### Request parameter
  626. | Name | Type | Required | Description |
  627. |--------------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------|
  628. | `dataset_id` | string | Yes | The ID of the dataset. Call ['GET' /dataset](#create-dataset) to retrieve the ID. |
  629. | `document_id` | string | Yes | The ID of the document. Call ['GET' /document](#list-documents) to retrieve the ID. |
  630. | `doc_ids` | list | No | The document IDs of the documents that the user would like to parse. Default: None, means all documents in the specified dataset. |
  631. ### Response
  632. ### Successful Response
  633. ```json
  634. {
  635. "code": 0,
  636. "data": true,
  637. "message": ""
  638. }
  639. ```
  640. ### Response for parsing documents which does not exist.
  641. ```json
  642. {
  643. "code": 101,
  644. "message": "This document 'imagination.txt' cannot be found!"
  645. }
  646. ```
  647. ### Response for parsing documents in the nonexistent dataset.
  648. ```json
  649. {
  650. "code": 102,
  651. "message": "This dataset 'imagination' cannot be found!"
  652. }
  653. ```
  654. ### Response for parsing documents, one of which is empty.
  655. ```json
  656. {
  657. "code": 0,
  658. "data": true,
  659. "message": "Empty data in the document: empty.txt; "
  660. }
  661. ```
  662. ## Show the parsing status of the document
  663. This method shows the parsing status of the document for a specific user.
  664. ### Request
  665. #### Request URI
  666. | Method | Request URI |
  667. |--------|-------------------------------------------------------|
  668. | GET | `/dataset/{dataset_id}/documents/status` |
  669. #### Request parameter
  670. | Name | Type | Required | Description |
  671. |--------------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------|
  672. | `dataset_id` | string | Yes | The ID of the dataset. Call ['GET' /dataset](#create-dataset) to retrieve the ID. |
  673. | `document_id` | string | Yes | The ID of the document. Call ['GET' /document](#list-documents) to retrieve the ID. |
  674. ### Response
  675. ### Successful Response
  676. ```json
  677. {
  678. "code": 0,
  679. "data": {
  680. "progress": 0.0,
  681. "status": "RUNNING"
  682. },
  683. "message": "success"
  684. }
  685. ```
  686. ### Response for showing the parsing status of a document which does not exist.
  687. ```json
  688. {
  689. "code": 102,
  690. "message": "This document: 'imagination.txt' is not a valid document."
  691. }
  692. ```
  693. ### Response for showing the parsing status of a document in the nonexistent dataset.
  694. ```json
  695. {
  696. "code": 102,
  697. "message": "This dataset 'imagination' cannot be found!"
  698. }
  699. ```