Obtenir le déploiement
curl --request GET \
--url https://macaly.com/api/chat/{chatId}/deployment \
--header 'Authorization: Bearer <token>'import requests
url = "https://macaly.com/api/chat/{chatId}/deployment"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://macaly.com/api/chat/{chatId}/deployment', 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://macaly.com/api/chat/{chatId}/deployment",
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://macaly.com/api/chat/{chatId}/deployment"
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://macaly.com/api/chat/{chatId}/deployment")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://macaly.com/api/chat/{chatId}/deployment")
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_bodyEndpoints
Obtenir le déploiement
Obtenez le statut de la dernière tentative de publication d’un chat
GET
/
api
/
chat
/
{chatId}
/
deployment
Obtenir le déploiement
curl --request GET \
--url https://macaly.com/api/chat/{chatId}/deployment \
--header 'Authorization: Bearer <token>'import requests
url = "https://macaly.com/api/chat/{chatId}/deployment"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://macaly.com/api/chat/{chatId}/deployment', 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://macaly.com/api/chat/{chatId}/deployment",
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://macaly.com/api/chat/{chatId}/deployment"
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://macaly.com/api/chat/{chatId}/deployment")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://macaly.com/api/chat/{chatId}/deployment")
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_bodyObtient le statut de la dernière tentative de publication d’un chat, ou de la tentative désignée par
deploymentId. La dernière tentative peut être encore en cours de build, ou avoir échoué alors qu’une version plus ancienne reste en ligne. Utilisez liveUrl pour obtenir l’URL de la version actuellement en ligne. Si le déploiement n’est pas dans un état final, cet endpoint synchronise le statut avec Vercel avant de répondre.
Requête
GET /api/chat/{chatId}/deployment
En-têtes
| En-tête | Requis | Description |
|---|---|---|
Authorization | Oui | Bearer macaly_... |
Paramètres de chemin
| Paramètre | Type | Description |
|---|---|---|
chatId | string | L’ID du chat |
Paramètres de requête
| Paramètre | Requis | Description |
|---|---|---|
deploymentId | Non | L’id ou le deploymentId renvoyé par POST /deploy. Sans ce paramètre, l’endpoint renvoie la dernière tentative de publication du chat. |
Exemple de requête
curl "https://www.macaly.com/api/chat/abc123/deployment?deploymentId=jzga0sttml37v6mbizb8tk1x" \
-H "Authorization: Bearer macaly_abc123..."
const response = await fetch(
`https://www.macaly.com/api/chat/${chatId}/deployment?deploymentId=${deploymentId}`,
{
headers: {
'Authorization': 'Bearer macaly_abc123...',
},
}
);
const data = await response.json();
console.log(data.status, data.liveUrl);
import requests
response = requests.get(
f'https://www.macaly.com/api/chat/{chat_id}/deployment',
params={'deploymentId': deployment_id},
headers={
'Authorization': 'Bearer macaly_abc123...',
},
)
data = response.json()
print(data['status'], data['liveUrl'])
Réponse
Déploiement prêt
{
"id": "jzga0sttml37v6mbizb8tk1x",
"url": "https://macaly-staging-abc123.macaly.app",
"status": "READY",
"deploymentId": "dpl_HKLBd2QDTwq58AMUJiaMyUzk8WUw",
"createdAt": "2025-01-12T21:18:54.906Z",
"error": null,
"domain": "macaly-staging-abc123.macaly.app",
"domains": [
{
"domain": "macaly-staging-abc123.macaly.app",
"verified": true,
"isCustomDomain": false
}
],
"liveUrl": "https://macaly-staging-abc123.macaly.app"
}
Aucun déploiement
{
"id": null,
"url": null,
"status": null,
"deploymentId": null,
"createdAt": null,
"error": null,
"domain": null,
"domains": [
{
"domain": "macaly-staging-abc123.macaly.app",
"verified": true,
"isCustomDomain": false
}
],
"liveUrl": null
}
Déploiement échoué
Une republication échouée laisse la version précédente en ligne :liveUrl reste donc renseigné.
{
"id": "jzga0sttml37v6mbizb8tk1x",
"url": "https://macaly-staging-abc123.macaly.app",
"status": "ERROR",
"deploymentId": "dpl_HKLBd2QDTwq58AMUJiaMyUzk8WUw",
"createdAt": "2025-01-12T21:18:54.906Z",
"error": ["Build failed: Module not found"],
"domain": "macaly-staging-abc123.macaly.app",
"domains": [],
"liveUrl": "https://macaly-staging-abc123.macaly.app"
}
Champs de la réponse
| Champ | Type | Description |
|---|---|---|
id | string | null | ID du déploiement en base de données (null si jamais déployé) |
url | string | null | L’URL du déploiement |
status | string | null | Statut du déploiement Vercel (voir ci-dessous) |
deploymentId | string | null | ID du déploiement Vercel |
createdAt | string | null | Horodatage ISO de la création du déploiement |
error | string[] | null | Messages d’erreur en cas d’échec du déploiement |
domain | string | null | Domaine principal du déploiement |
domains | array | Tous les domaines connectés |
domains[].domain | string | Nom de domaine |
domains[].verified | boolean | Si le domaine est vérifié |
domains[].isCustomDomain | boolean | S’il s’agit d’un domaine personnalisé |
liveUrl | string | null | URL de la version en ligne (null si rien n’est en ligne) |
Valeurs de statut du déploiement
| Statut | Description |
|---|---|
QUEUED | Déploiement en file d’attente |
BUILDING | Build en cours |
READY | Déploiement réussi |
ERROR | Déploiement échoué |
CANCELED | Déploiement annulé |
UNPUBLISHED | Déploiement dépublié |
Codes de statut
| Statut | Description |
|---|---|
| 200 | Succès (même si aucun déploiement n’existe, retourne des champs null) |
| 401 | Clé API invalide ou manquante |
| 403 | Le chat n’appartient pas à votre équipe |
| 404 | Chat introuvable, ou deploymentId ne correspond à aucun déploiement de ce chat |
Pattern de polling
Transmettez l’id renvoyé par POST /deploy comme deploymentId.
while true; do
DEPLOYMENT=$(curl -s "https://www.macaly.com/api/chat/$CHAT_ID/deployment?deploymentId=$DEPLOYMENT_ID" \
-H "Authorization: Bearer macaly_...")
STATUS=$(echo $DEPLOYMENT | jq -r '.status')
echo "Status: $STATUS"
if [[ $STATUS == "READY" ]]; then
echo "Deployed: $(echo $DEPLOYMENT | jq -r '.liveUrl')"
break
elif [[ $STATUS == "ERROR" ]]; then
echo "Failed: $(echo $DEPLOYMENT | jq -r '.error')"
break
fi
sleep 3
done
Cette page vous a-t-elle été utile ?