静态导出
获取静态导出作业状态
获取静态导出任务的当前状态和进度。启动任务后,可以轮询此端点,直到 status 变为 completed(或 failed)。
静态导出仅适用于 Enterprise 套餐。
GET
/
static-export
/
jobs
/
{jobId}
获取静态导出任务状态
curl --request GET \
--url https://api.mintlify.com/v1/static-export/jobs/{jobId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v1/static-export/jobs/{jobId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mintlify.com/v1/static-export/jobs/{jobId}', 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.mintlify.com/v1/static-export/jobs/{jobId}",
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.mintlify.com/v1/static-export/jobs/{jobId}"
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.mintlify.com/v1/static-export/jobs/{jobId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v1/static-export/jobs/{jobId}")
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{
"jobId": "se_3f9a2c1b8e7d4a06",
"status": "running",
"progress": 42,
"pageCount": 128,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}静态导出需要 Enterprise 套餐。
授权
管理员 API 密钥。可在控制台的 API 密钥页面生成。
路径参数
由 Start static export job 返回的静态导出任务的 ID。
响应
导出任务的当前状态。
静态导出任务的唯一标识符。
示例:
"se_3f9a2c1b8e7d4a06"
任务的当前状态。
可用选项:
queued, running, completed, failed 示例:
"running"
完成百分比,范围为 0 到 100。
必填范围:
0 <= x <= 100示例:
42
目前已导出的页面数量。
示例:
128
任务的创建时间。
任务的最后更新时间。
人类可读的错误消息。仅当 status 为 failed 时才会出现。
此页面对您有帮助吗?
⌘I
获取静态导出任务状态
curl --request GET \
--url https://api.mintlify.com/v1/static-export/jobs/{jobId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v1/static-export/jobs/{jobId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mintlify.com/v1/static-export/jobs/{jobId}', 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.mintlify.com/v1/static-export/jobs/{jobId}",
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.mintlify.com/v1/static-export/jobs/{jobId}"
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.mintlify.com/v1/static-export/jobs/{jobId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v1/static-export/jobs/{jobId}")
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{
"jobId": "se_3f9a2c1b8e7d4a06",
"status": "running",
"progress": 42,
"pageCount": 128,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}