通过document id获取文档详情
curl --request GET \
--url https://api-spectra.duplik.cn/v1/knowledge/document/{document_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"org_id": "<string>",
"user_id": "<string>",
"dataset_id": "<string>",
"file_id": "<string>",
"document_id": "<string>",
"created_at": 123,
"updated_at": 123,
"overall_summarize_enabled": true,
"smart_indexing_mode": 0,
"smart_indexing_enabled": true,
"split_media_enabled": true,
"pdf_parsing_mode": 2,
"pdf_parsing_element_types": [
1,
2
],
"read_pdf_pages": "<string>",
"audio_parsing_mode": 123,
"audio_chunk_mode": 1,
"name": "<string>",
"document_type": 1,
"next_step": true,
"llm": {},
"metadata_info": {},
"task_priority": 123,
"description": "",
"summary": "",
"step_status": 100,
"status": 1,
"process_status": 100,
"version": 2,
"splitter_type": 1,
"splitter": {},
"sections": [],
"content_text": "<string>",
"trim_text": true
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Knowledge
通过document id获取文档详情
获取一个文档
GET
/
v1
/
knowledge
/
document
/
{document_id}
通过document id获取文档详情
curl --request GET \
--url https://api-spectra.duplik.cn/v1/knowledge/document/{document_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-spectra.duplik.cn/v1/knowledge/document/{document_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"org_id": "<string>",
"user_id": "<string>",
"dataset_id": "<string>",
"file_id": "<string>",
"document_id": "<string>",
"created_at": 123,
"updated_at": 123,
"overall_summarize_enabled": true,
"smart_indexing_mode": 0,
"smart_indexing_enabled": true,
"split_media_enabled": true,
"pdf_parsing_mode": 2,
"pdf_parsing_element_types": [
1,
2
],
"read_pdf_pages": "<string>",
"audio_parsing_mode": 123,
"audio_chunk_mode": 1,
"name": "<string>",
"document_type": 1,
"next_step": true,
"llm": {},
"metadata_info": {},
"task_priority": 123,
"description": "",
"summary": "",
"step_status": 100,
"status": 1,
"process_status": 100,
"version": 2,
"splitter_type": 1,
"splitter": {},
"sections": [],
"content_text": "<string>",
"trim_text": true
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
文档ID
Response
Successful Response
Maximum string length:
20Maximum string length:
20Generate an overall summary. Boolean
Smart indexing mode. 0: disabled (recommended), 1: standard, 2: advanced
Enable smart indexing. Boolean. Takes effect only together with smart_indexing_mode 2 (advanced); leaving it false is recommended unless the corpus needs it, as it adds noticeable processing time and token cost
Generate media segments. Boolean
PDF parsing mode. 1: page, 2: section (recommended), 3: section v2
pdf parsing element list, eg: [1, 2]. 1: table, 2: image, 3: formula
read pdf pages, Example: '1,3,4' or '1,4-end' or 'all'
audio parsing mode, 1: transcript, 2: speaker diarization
Maximum string length:
256next step
task priority
Maximum string length:
512