跳转到主要内容
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 套餐

授权

Authorization
string
header
必填

管理员 API 密钥。可在控制台的 API 密钥页面生成。

路径参数

jobId
string
必填

Start static export job 返回的静态导出任务的 ID。

响应

导出任务的当前状态。

jobId
string
必填

静态导出任务的唯一标识符。

示例:

"se_3f9a2c1b8e7d4a06"

status
enum<string>
必填

任务的当前状态。

可用选项:
queued,
running,
completed,
failed
示例:

"running"

progress
number
必填

完成百分比,范围为 0 到 100。

必填范围: 0 <= x <= 100
示例:

42

pageCount
integer
必填

目前已导出的页面数量。

示例:

128

createdAt
string<date-time>
必填

任务的创建时间。

updatedAt
string<date-time>
必填

任务的最后更新时间。

error
string | null

人类可读的错误消息。仅当 statusfailed 时才会出现。