Deploy
curl --request POST \
--url https://macaly.com/api/chat/{chatId}/deploy \
--header 'Authorization: Bearer <token>'import requests
url = "https://macaly.com/api/chat/{chatId}/deploy"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://macaly.com/api/chat/{chatId}/deploy', 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}/deploy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/deploy"
req, _ := http.NewRequest("POST", 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.post("https://macaly.com/api/chat/{chatId}/deploy")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://macaly.com/api/chat/{chatId}/deploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyEndpoint
Deploy
Deployment di una chat in produzione
POST
/
api
/
chat
/
{chatId}
/
deploy
Deploy
curl --request POST \
--url https://macaly.com/api/chat/{chatId}/deploy \
--header 'Authorization: Bearer <token>'import requests
url = "https://macaly.com/api/chat/{chatId}/deploy"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://macaly.com/api/chat/{chatId}/deploy', 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}/deploy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/deploy"
req, _ := http.NewRequest("POST", 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.post("https://macaly.com/api/chat/{chatId}/deploy")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://macaly.com/api/chat/{chatId}/deploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyEffettua il deployment di una chat in produzione. Avvia un deployment su Vercel e restituisce subito una risposta.
Richiesta
POST /api/chat/{chatId}/deploy
Header
| Header | Obbligatorio | Descrizione |
|---|---|---|
Authorization | Sì | Bearer macaly_... |
Parametri del percorso
| Parametro | Tipo | Descrizione |
|---|---|---|
chatId | string | L’ID della chat di cui effettuare il deployment |
Esempio di richiesta
curl -X POST https://www.macaly.com/api/chat/abc123/deploy \
-H "Authorization: Bearer macaly_abc123..."
const response = await fetch(
`https://www.macaly.com/api/chat/${chatId}/deploy`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer macaly_abc123...',
},
}
);
const data = await response.json();
console.log(data.url);
import requests
response = requests.post(
f'https://www.macaly.com/api/chat/{chat_id}/deploy',
headers={
'Authorization': 'Bearer macaly_abc123...',
},
)
data = response.json()
print(data['url'])
Risposta
{
"id": "jzga0sttml37v6mbizb8tk1x",
"url": "https://macaly-staging-abc123.macaly.app",
"status": "QUEUED",
"deploymentId": "dpl_HKLBd2QDTwq58AMUJiaMyUzk8WUw"
}
Campi della risposta
| Campo | Tipo | Descrizione |
|---|---|---|
id | string | ID del deployment nel database |
url | string | La URL del deployment |
status | "QUEUED" | "BUILDING" | Stato iniziale |
deploymentId | string | ID del deployment su Vercel |
Codici di stato
| Codice | Descrizione |
|---|---|
| 200 | Deployment avviato |
| 400 | Richiesta non valida (ad esempio nessun messaggio nella chat) |
| 401 | Chiave API non valida o mancante |
| 403 | Permessi insufficienti per il deployment oppure la chat non appartiene al team |
| 404 | Chat non trovata |
| 500 | Errore interno del server |
Note
Questo endpoint restituisce una risposta subito dopo l’avvio del deployment. Il deployment avviene in modo asincrono su Vercel.
- Usa
GET /api/chat/{chatId}/deploymentcondeploymentIdimpostato sull’idrestituito per seguire l’avanzamento fino al completamento - Richiede il permesso
hosting.publish_macaly
Passaggi successivi
Dopo aver avviato un deployment:- Segui l’avanzamento con
GET /api/chat/{chatId}/deployment, condeploymentIdimpostato sull’idrestituito - Attendi che
statusdiventiREADY
Questa pagina è stata utile?