Obtenir le statut d'une tâche d'exportation statique
Récupère le statut actuel d’une tâche d’export statique. Interrogez cet endpoint après avoir lancé une tâche jusqu’à ce que status soit completed (ou failed).
Une fois la tâche terminée, la réponse inclut bundleUrl, sizeBytes et expiresAt. bundleUrl est un lien S3 présigné limité dans le temps. Téléchargez le paquet avant l’horodatage expiresAt. Rappelez cet endpoint pour obtenir un nouveau lien. Les fichiers d’export sous-jacents restent réutilisables.
Authentifiez-vous avec une clé d’API administrateur.
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>"
}Autorisations
L'en-tête Authorization requiert un jeton Bearer. Utilisez une clé d'API administrateur. Il s'agit d'une clé secrète côté serveur. Générez-en une depuis la page des clés d'API de votre Dashboard.
Paramètres de chemin
L’identifiant de votre projet. Peut être copié depuis la page des clés d'API de votre Dashboard.
Réponse
L’état actuel de la tâche d’export.
Un lien S3 présigné limité dans le temps vers l’archive du paquet d’export statique. Présent uniquement lorsque status est completed. Téléchargez le paquet avant expiresAt. Rappelez cet endpoint pour obtenir un nouveau lien.
"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>"
}