解析结果
curl --request GET \
--url https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type} \
--header 'Authorization: Bearer <token>'import requests
url = "https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type}")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type}"
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type}",
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;
}{
"status": "succeeded",
"message": "结果获取成功",
"task_id": "task_123456789",
"content": "这是解析后的文本内容...",
"parsing_result_url": "https://example.com/download/result.zip"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}工具 API
解析结果
异步获取文件解析任务的结果,支持返回纯文本或下载链接格式。见 文件解析服务。点击 Try it 按钮可快速试用。
GET
/
paas
/
v4
/
files
/
parser
/
result
/
{taskId}
/
{format_type}
解析结果
curl --request GET \
--url https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type} \
--header 'Authorization: Bearer <token>'import requests
url = "https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type}")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type}"
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://open.bigmodel.cn/api/paas/v4/files/parser/result/{taskId}/{format_type}",
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;
}{
"status": "succeeded",
"message": "结果获取成功",
"task_id": "task_123456789",
"content": "这是解析后的文本内容...",
"parsing_result_url": "https://example.com/download/result.zip"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Path Parameters
文件解析任务ID
Example:
"task_123456789"
结果返回格式类型
Available options:
text, download_link Example:
"text"
Response
结果获取成功
任务处理状态
Available options:
processing, succeeded, failed Example:
"succeeded"
结果状态描述
Example:
"结果获取成功"
文件解析任务ID
Example:
"task_123456789"
当format_type=text时返回的解析文本内容
Example:
"这是解析后的文本内容..."
当format_type=download_link时返回的结果下载链接
Example:
"https://example.com/download/result.zip"
Was this page helpful?