Enviar mensaje EventStream
curl --request PUT \
--url https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId} \
--header 'Content-Type: application/json' \
--header 'apikey: <apikey>' \
--data '
{
"message": "<string>"
}
'import requests
url = "https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}"
payload = { "message": "<string>" }
headers = {
"apikey": "<apikey>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {apikey: '<apikey>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>'})
};
fetch('https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}', 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://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <apikey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}"
payload := strings.NewReader("{\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("apikey", "<apikey>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}")
.header("apikey", "<apikey>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["apikey"] = '<apikey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyEndpoints principales
Enviar mensaje EventStream
Envía un mensaje de texto a una sesión activa del Canal API EventStream.
PUT
/
assistants-channel
/
api
/
v1
/
channel
/
api
/
eventstream
/
{sessionId}
/
{consumerId}
Enviar mensaje EventStream
curl --request PUT \
--url https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId} \
--header 'Content-Type: application/json' \
--header 'apikey: <apikey>' \
--data '
{
"message": "<string>"
}
'import requests
url = "https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}"
payload = { "message": "<string>" }
headers = {
"apikey": "<apikey>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {apikey: '<apikey>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>'})
};
fetch('https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}', 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://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <apikey>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}"
payload := strings.NewReader("{\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("apikey", "<apikey>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}")
.header("apikey", "<apikey>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["apikey"] = '<apikey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyEnvía un mensaje de texto del usuario a una sesión activa. La respuesta del asistente no se devuelve en esta petición: se recibe por el stream SSE abierto con Init o Listen.
Endpoint
PUT /assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}
Autenticación
string
required
API Key proporcionada para tu integración.
Parámetros de ruta
string
required
Identificador de la sesión obtenido desde el evento
Initialized.string
required
Identificador del consumer obtenido desde el evento
Initialized.Body
string
required
Mensaje de texto que se enviará al asistente.
Request
{
"message": "¿Cuál es el estado de mi pedido?"
}
Ejemplos
curl -X PUT "https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{sessionId}/{consumerId}" \
-H "Content-Type: application/json" \
-H "apikey: tu-api-key-aqui" \
-d '{"message":"¿Cuál es el estado de mi pedido?"}'
const sessionId = "uuid-de-sesion";
const consumerId = "uuid-del-consumer";
const response = await fetch(
`https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/${sessionId}/${consumerId}`,
{
method: "PUT",
headers: {
"Content-Type": "application/json",
apikey: process.env.INCONCERT_API_KEY
},
body: JSON.stringify({
message: "¿Cuál es el estado de mi pedido?"
})
}
);
if (!response.ok) {
throw new Error(`Error enviando mensaje: ${response.status}`);
}
import os
import requests
session_id = "uuid-de-sesion"
consumer_id = "uuid-del-consumer"
url = f"https://api.backend.inconcertcc.com/assistants-channel/api/v1/channel/api/eventstream/{session_id}/{consumer_id}"
headers = {
"Content-Type": "application/json",
"apikey": os.environ["INCONCERT_API_KEY"]
}
payload = {
"message": "¿Cuál es el estado de mi pedido?"
}
response = requests.put(url, headers=headers, json=payload, timeout=10)
response.raise_for_status()
Respuesta
| Código | Descripción |
|---|---|
201 | Mensaje enviado correctamente. |
400 | Error en la petición. |
Para recibir la respuesta del asistente, mantén abierto el stream SSE de la sesión. Busca eventos como
crew.status.writing, assistant.response, assistant.message y crew.status.waiting.Was this page helpful?
⌘I

