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_bodyVégpontok
Get deployment
Egy beszélgetés legutóbbi közzétételi kísérlete állapotának lekérése
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_bodyLekéri egy beszélgetés legutóbbi közzétételi kísérletének állapotát, vagy annak a kísérletnek az állapotát, amelyet a
deploymentId megad. A legutóbbi kísérlet még épülhet, vagy sikertelen lehet, miközben egy korábbi verzió élesben marad. Az éppen élő verzió URL-jét a liveUrl adja meg. Ha a közzététel még nem végleges állapotban van, a végpont a válasz előtt szinkronizálja az állapotot a Vercellel.
Kérés
GET /api/chat/{chatId}/deployment
Fejlécek
| Fejléc | Kötelező | Leírás |
|---|---|---|
Authorization | Igen | Bearer macaly_... |
Útvonalparaméterek
| Paraméter | Típus | Leírás |
|---|---|---|
chatId | string | A beszélgetés azonosítója |
Lekérdezési paraméterek
| Paraméter | Kötelező | Leírás |
|---|---|---|
deploymentId | Nem | Az az id vagy deploymentId, amelyet a POST /deploy visszaadott. Nélküle a végpont a beszélgetés legutóbbi közzétételi kísérletét adja vissza. |
Példa kérés
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'])
Válasz
A közzététel kész
{
"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"
}
Nincs közzététel
{
"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
}
A közzététel sikertelen
Egy sikertelen újbóli közzététel élesben hagyja az előző verziót, így aliveUrl továbbra is ki van töltve.
{
"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"
}
Válaszmezők
| Mező | Típus | Leírás |
|---|---|---|
id | string | null | Az adatbázisban tárolt közzététel azonosítója (null, ha még nem volt közzétéve) |
url | string | null | A közzétett oldal URL-je |
status | string | null | A Vercel-közzététel állapota (lásd lent) |
deploymentId | string | null | A Vercel-közzététel azonosítója |
createdAt | string | null | A közzététel létrehozásának ISO-időbélyege |
error | string[] | null | Hibaüzenetek, ha a közzététel sikertelen volt |
domain | string | null | A közzététel elsődleges domainje |
domains | array | Az összes csatlakoztatott domain |
domains[].domain | string | A domain neve |
domains[].verified | boolean | Ellenőrzött-e a domain |
domains[].isCustomDomain | boolean | Egyéni domain-e |
liveUrl | string | null | Az élő verzió URL-je (null, ha semmi sincs élesben) |
Közzétételi állapotok
| Állapot | Leírás |
|---|---|
QUEUED | A közzététel sorban áll |
BUILDING | Az építés folyamatban van |
READY | A közzététel sikeres |
ERROR | A közzététel sikertelen |
CANCELED | A közzététel megszakadt |
UNPUBLISHED | A közzététel vissza lett vonva |
Állapotkódok
| Állapot | Leírás |
|---|---|
| 200 | Sikeres (akkor is, ha nincs közzététel, ilyenkor a mezők értéke null) |
| 401 | Érvénytelen vagy hiányzó API-kulcs |
| 403 | A beszélgetés nem a munkaterülethez tartozik |
| 404 | A beszélgetés nem található, vagy a deploymentId a beszélgetés egyik közzétételével sem egyezik |
Lekérdezési minta
Add át aPOST /deploy által visszaadott id értéket deploymentId-ként.
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
Hasznos volt ez az oldal?