Get deployment
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
Get deployment
Ruft den Status des neuesten Veröffentlichungsversuchs für einen Chat ab
GET
/
api
/
chat
/
{chatId}
/
deployment
Get deployment
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_bodyRuft den Status des neuesten Veröffentlichungsversuchs für einen Chat ab, oder des Versuchs, den
deploymentId angibt. Der neueste Versuch kann noch im Build sein oder fehlgeschlagen sein, während eine ältere Version live bleibt. Die URL der Version, die gerade live ist, steht in liveUrl. Befindet sich das Deployment nicht in einem finalen Status, synchronisiert dieser Endpoint den Status zunächst mit Vercel, bevor er antwortet.
Anfrage
GET /api/chat/{chatId}/deployment
Header
| Header | Erforderlich | Beschreibung |
|---|---|---|
Authorization | Ja | Bearer macaly_... |
Pfadparameter
| Parameter | Typ | Beschreibung |
|---|---|---|
chatId | string | Die Chat-ID |
Query-Parameter
| Parameter | Erforderlich | Beschreibung |
|---|---|---|
deploymentId | Nein | Die id oder deploymentId, die POST /deploy zurückgegeben hat. Ohne sie liefert der Endpoint den neuesten Veröffentlichungsversuch des Chats. |
Beispielanfrage
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'])
Antwort
Deployment bereit
{
"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"
}
Kein Deployment
{
"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
}
Deployment fehlgeschlagen
Eine fehlgeschlagene erneute Veröffentlichung lässt die vorherige Version live, daher bleibtliveUrl gesetzt.
{
"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"
}
Antwortfelder
| Feld | Typ | Beschreibung |
|---|---|---|
id | string | null | Datenbank-ID des Deployments (null, wenn nie deployt) |
url | string | null | Die Deployment-URL |
status | string | null | Vercel-Deployment-Status (siehe unten) |
deploymentId | string | null | Vercel-Deployment-ID |
createdAt | string | null | ISO-Zeitstempel der Deployment-Erstellung |
error | string[] | null | Fehlermeldungen, falls das Deployment fehlgeschlagen ist |
domain | string | null | Primäre Domain für das Deployment |
domains | array | Alle verbundenen Domains |
domains[].domain | string | Domainname |
domains[].verified | boolean | Ob die Domain verifiziert ist |
domains[].isCustomDomain | boolean | Ob es sich um eine eigene Domain handelt |
liveUrl | string | null | URL der Live-Version (null, wenn nichts live ist) |
Deployment-Statuswerte
| Status | Beschreibung |
|---|---|
QUEUED | Deployment ist in der Warteschlange |
BUILDING | Build läuft |
READY | Deployment erfolgreich |
ERROR | Deployment fehlgeschlagen |
CANCELED | Deployment wurde abgebrochen |
UNPUBLISHED | Aus der Produktion entfernt |
Statuscodes
| Status | Beschreibung |
|---|---|
| 200 | Erfolgreich (auch wenn kein Deployment existiert, werden null-Felder zurückgegeben) |
| 401 | Ungültiger oder fehlender API-Schlüssel |
| 403 | Chat gehört nicht zu deinem Team |
| 404 | Chat nicht gefunden, oder deploymentId passt zu keinem Deployment dieses Chats |
Polling-Muster
Übergib dieid, die POST /deploy zurückgegeben hat, als 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
War diese Seite hilfreich?