Publish message
curl --request POST \
--url https://macaly.com/api/chat/{chatId}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://macaly.com/api/chat/{chatId}/publish"
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}/publish', 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}/publish",
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}/publish"
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}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://macaly.com/api/chat/{chatId}/publish")
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_bodyVégpontok
Publish message
Új üzenet küldése egy meglévő beszélgetésbe a párbeszéd folytatásához
POST
/
api
/
chat
/
{chatId}
/
publish
Publish message
curl --request POST \
--url https://macaly.com/api/chat/{chatId}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://macaly.com/api/chat/{chatId}/publish"
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}/publish', 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}/publish",
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}/publish"
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}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://macaly.com/api/chat/{chatId}/publish")
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_bodyÚj üzenetet küld egy meglévő beszélgetésbe, és folytatja a párbeszédet.
JSON-válasz (ha
A befejezésre a Get Status végpont lekérdezésével várhatsz.
Adatfolyam-válasz (ha
Kérés
POST /api/chat/{chatId}/publish
Fejlécek
| Fejléc | Kötelező | Leírás |
|---|---|---|
Authorization | Igen | Bearer macaly_... |
Content-Type | Igen | application/json |
Útvonalparaméterek
| Paraméter | Típus | Leírás |
|---|---|---|
chatId | string | A beszélgetés azonosítója |
Törzsparaméterek
| Mező | Típus | Kötelező | Alapérték | Leírás |
|---|---|---|---|---|
content | string | Feltételes | - | A felhasználó üzenete. Kötelező, kivéve ha a resume értéke true |
stream | boolean | Nem | true | Ha false, adatfolyam helyett JSON-t ad vissza |
agentMode | "auto" | "fast" | "smart" | Nem | "auto" | Az AI-ügynök sebessége és minősége közötti egyensúlyt szabályozza |
executionMode | "auto" | "planning" | "build" | Nem | "auto" | Azt szabályozza, hogyan közelíti meg az AI a feladatot |
model | "gpt-5.6-terra" | "gpt-6.1-sol" | "gpt-6-luna" | "grok-4-6" | "kimi-k3" | "sonnet-5-5" | "opus-5-5" | "blueai-glm-5-3" | "blueai-glm-5-3-flash" | Nem | - | A használt AI-modell. Alapértelmezés szerint a munkaterületen beállított modell |
reasoningEffort | "medium" | "high" | Nem | - | Azt szabályozza, mennyire mélyen gondolkodik az AI a feladaton |
resume | boolean | Nem | false | Ha true, új tartalom hozzáadása nélkül folytatja a leállított beszélgetést |
experimental_attachments | array | Nem | [] | Fájlmellékletek (a formátumot lásd a Create Chat oldalon) |
Ha a
resume értéke true, nem küldhetsz content vagy experimental_attachments mezőt. Ezzel a korábban leállított beszélgetést lehet folytatni.Példa kérés
curl -X POST "https://www.macaly.com/api/chat/abc123def456/publish" \
-H "Authorization: Bearer macaly_abc123..." \
-H "Content-Type: application/json" \
-d '{
"content": "Add a dark mode toggle to the header",
"stream": false
}'
const response = await fetch(
`https://www.macaly.com/api/chat/${chatId}/publish`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer macaly_abc123...',
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: 'Add a dark mode toggle to the header',
stream: false,
}),
}
);
const data = await response.json();
import requests
response = requests.post(
f'https://www.macaly.com/api/chat/{chat_id}/publish',
headers={
'Authorization': 'Bearer macaly_abc123...',
'Content-Type': 'application/json',
},
json={
'content': 'Add a dark mode toggle to the header',
'stream': False,
},
)
data = response.json()
Válasz
JSON-válasz (ha stream: false)
{
"chatId": "abc123def456",
"streamId": "stream_xyz789",
"assistantMessageId": "msg_123"
}
Adatfolyam-válasz (ha stream: true, ez az alapérték)
2:[{"chatId":"abc123def456"}]
0:"Analyzing your request..."
...
Állapotkódok
| Állapot | Leírás |
|---|---|
| 200 | Sikeres - az üzenet elküldve |
| 400 | Érvénytelen kéréstörzs |
| 401 | Érvénytelen vagy hiányzó API-kulcs |
| 402 | Nincs elég kredit |
| 403 | A beszélgetés nem ehhez a munkaterülethez tartozik |
| 404 | A beszélgetés nem található |
| 429 | Túllépted a kérési korlátot |
| 500 | Szerverhiba |
| 503 | A szolgáltatás nem elérhető - Az AI-munkakörnyezet foglalt, próbáld újra egy kis idő múlva |
Munkafolyamat
Adatfolyam nélküli használatnál a szokásos munkafolyamat:- Küldd el az üzenetet
stream: falsebeállítással - Kérdezd le az állapotot a
GET /api/chat/{chatId}/statusvégponttal, amíg az eredménycompletednem lesz - Ismételd további üzeneteknél
Hasznos volt ez az oldal?