查询文档转换异步任务
curl --request GET \
--url https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id} \
--header 'X-API-KEY: <api-key>'const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.get("https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}")
.header("X-API-KEY", "<api-key>")
.asString();const url = 'https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}';
const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}using RestSharp;
var options = new RestClientOptions("https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-API-KEY", "<api-key>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_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 => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"code": "success",
"message": "",
"tips": null,
"data": {
"task_id": "task_abc123",
"img_detail_list": [
{
"page_num": 1,
"img_base64": "",
"img_url": "https://example.com/temp/task_abc123/page-1.png",
"width": 1240,
"height": 1754,
"preprocess": {}
}
],
"total_num": 1,
"metadata": {},
"file_type": "pdf",
"source_file_type": "pdf",
"spreadsheet_manifest_file_id": "",
"spreadsheet_manifest_url": "",
"view_type": "",
"page_count": 1,
"sheet_count": 0,
"logical_unit_count": 0,
"document_contents": [],
"document_details": [],
"warnings": [],
"billing": {}
}
}{
"detail": [
{
"type": "greater_than",
"loc": [
"query",
"limit"
],
"msg": "Input should be greater than 0",
"input": 0,
"ctx": {
"gt": 0
}
}
]
}文档转换
查询文档转换异步任务
根据 task_id 查询转换结果。当前响应没有独立的任务状态字段;任务仍在处理时可能返回 code=success 以及空的 img_detail_list/total_num。请使用退避轮询,并在取得页面结果或电子表格结构后再结束。
空结果不能可靠区分“处理中”和“无可视页面”,请为客户端设置总超时和最大轮询次数。
GET
/
open
/
agentic_doc_processor
/
{tenant_name}
/
v1
/
doc
/
convert
/
query
/
task
/
{task_id}
查询文档转换异步任务
curl --request GET \
--url https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id} \
--header 'X-API-KEY: <api-key>'const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.get("https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}")
.header("X-API-KEY", "<api-key>")
.asString();const url = 'https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}';
const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}using RestSharp;
var options = new RestClientOptions("https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-API-KEY", "<api-key>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://adp.laiye.com/open/agentic_doc_processor/{tenant_name}/v1/doc/convert/query/task/{task_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 => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"code": "success",
"message": "",
"tips": null,
"data": {
"task_id": "task_abc123",
"img_detail_list": [
{
"page_num": 1,
"img_base64": "",
"img_url": "https://example.com/temp/task_abc123/page-1.png",
"width": 1240,
"height": 1754,
"preprocess": {}
}
],
"total_num": 1,
"metadata": {},
"file_type": "pdf",
"source_file_type": "pdf",
"spreadsheet_manifest_file_id": "",
"spreadsheet_manifest_url": "",
"view_type": "",
"page_count": 1,
"sheet_count": 0,
"logical_unit_count": 0,
"document_contents": [],
"document_details": [],
"warnings": [],
"billing": {}
}
}{
"detail": [
{
"type": "greater_than",
"loc": [
"query",
"limit"
],
"msg": "Input should be greater than 0",
"input": 0,
"ctx": {
"gt": 0
}
}
]
}授权
生产环境 API Key,可在 ADP 平台的「我的 API」中查看。请确保 API Key 有效且属于生产环境。
路径参数
租户名称,默认 laiye。
创建异步转换任务后返回的任务 ID。
Minimum string length:
1