Obtener estado del job de exportación estática
Recupera el estado actual de un trabajo de exportación estática. Consulta este endpoint después de iniciar un trabajo hasta que status sea completed (o failed).
Una vez que el trabajo se completa, la respuesta incluye bundleUrl, sizeBytes y expiresAt. bundleUrl es un enlace de S3 prefirmado con tiempo limitado. Descarga el paquete antes de la marca de tiempo expiresAt. Vuelve a llamar a este endpoint para obtener un enlace nuevo. Los archivos de exportación subyacentes siguen siendo reutilizables.
Autentícate con una clave de API de administrador.
curl --request GET \
--url https://api.mintlify.com/v1/static-export/{projectId}/jobs/{jobId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v1/static-export/{projectId}/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/{projectId}/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/{projectId}/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/{projectId}/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/{projectId}/jobs/{jobId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v1/static-export/{projectId}/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": "6520f3a1c9b1a20012ab34cd",
"status": "completed",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"bundleUrl": "https://mintlify-static-exports.s3.amazonaws.com/6520f3a1c9b1a20012ab34cd/export.zip?X-Amz-Signature=...",
"sizeBytes": 18432000,
"expiresAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Autorizaciones
El encabezado Authorization requiere un token de tipo Bearer. Usa una clave de API de administrador. Esta es una clave secreta del lado del servidor. Genera una en la página de claves de API de tu dashboard.
Parámetros de ruta
El ID de tu proyecto. Puedes copiarlo desde la página de claves de API de tu dashboard.
Respuesta
El estado actual del trabajo de exportación.
Un enlace de S3 prefirmado con tiempo limitado al archivo del paquete de exportación estática. Solo está presente cuando status es completed. Descarga el paquete antes de expiresAt. Vuelve a llamar a este endpoint para obtener un enlace nuevo.
"https://mintlify-static-exports.s3.amazonaws.com/6520f3a1c9b1a20012ab34cd/export.zip?X-Amz-Signature=..."
curl --request GET \
--url https://api.mintlify.com/v1/static-export/{projectId}/jobs/{jobId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v1/static-export/{projectId}/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/{projectId}/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/{projectId}/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/{projectId}/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/{projectId}/jobs/{jobId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v1/static-export/{projectId}/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": "6520f3a1c9b1a20012ab34cd",
"status": "completed",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"bundleUrl": "https://mintlify-static-exports.s3.amazonaws.com/6520f3a1c9b1a20012ab34cd/export.zip?X-Amz-Signature=...",
"sizeBytes": 18432000,
"expiresAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}