curl --request POST \
--url https://api.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Secret: <api-key>' \
--data @- <<EOF
{
"session_key": "wa:+628123456789",
"message": "Hi, I'm Budi"
}
EOFimport requests
url = "https://api.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream"
payload = {
"session_key": "wa:+628123456789",
"message": "Hi, I'm Budi"
}
headers = {
"X-Client-ID": "<api-key>",
"X-API-Key": "<api-key>",
"X-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-ID': '<api-key>',
'X-API-Key': '<api-key>',
'X-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({session_key: 'wa:+628123456789', message: 'Hi, I\'m Budi'})
};
fetch('https://api.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream', 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.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'session_key' => 'wa:+628123456789',
'message' => 'Hi, I\'m Budi'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Client-ID: <api-key>",
"X-Secret: <api-key>"
],
]);
$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.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream"
payload := strings.NewReader("{\n \"session_key\": \"wa:+628123456789\",\n \"message\": \"Hi, I'm Budi\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-ID", "<api-key>")
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("X-Secret", "<api-key>")
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.post("https://api.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream")
.header("X-Client-ID", "<api-key>")
.header("X-API-Key", "<api-key>")
.header("X-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session_key\": \"wa:+628123456789\",\n \"message\": \"Hi, I'm Budi\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-ID"] = '<api-key>'
request["X-API-Key"] = '<api-key>'
request["X-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"session_key\": \"wa:+628123456789\",\n \"message\": \"Hi, I'm Budi\"\n}"
response = http.request(request)
puts response.read_body<string>Stream Chatbot Message
Same as Send Chatbot Message, streamed via Server-Sent Events. Events: session (first), typing, progress (), delta (, live LLM tokens), message (a complete step reply), error () and done (always last; same shape as the blocking data).
curl --request POST \
--url https://api.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Client-ID: <api-key>' \
--header 'X-Secret: <api-key>' \
--data @- <<EOF
{
"session_key": "wa:+628123456789",
"message": "Hi, I'm Budi"
}
EOFimport requests
url = "https://api.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream"
payload = {
"session_key": "wa:+628123456789",
"message": "Hi, I'm Budi"
}
headers = {
"X-Client-ID": "<api-key>",
"X-API-Key": "<api-key>",
"X-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Client-ID': '<api-key>',
'X-API-Key': '<api-key>',
'X-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({session_key: 'wa:+628123456789', message: 'Hi, I\'m Budi'})
};
fetch('https://api.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream', 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.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'session_key' => 'wa:+628123456789',
'message' => 'Hi, I\'m Budi'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Client-ID: <api-key>",
"X-Secret: <api-key>"
],
]);
$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.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream"
payload := strings.NewReader("{\n \"session_key\": \"wa:+628123456789\",\n \"message\": \"Hi, I'm Budi\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Client-ID", "<api-key>")
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("X-Secret", "<api-key>")
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.post("https://api.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream")
.header("X-Client-ID", "<api-key>")
.header("X-API-Key", "<api-key>")
.header("X-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"session_key\": \"wa:+628123456789\",\n \"message\": \"Hi, I'm Budi\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shieldbase.ai/external/chatbots/{chatbot_id}/messages/stream")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Client-ID"] = '<api-key>'
request["X-API-Key"] = '<api-key>'
request["X-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"session_key\": \"wa:+628123456789\",\n \"message\": \"Hi, I'm Budi\"\n}"
response = http.request(request)
puts response.read_body<string>Authorizations
Headers
Optional tenant selector for multitenant accounts. The API key owner must have access to the selected tenant.
Path Parameters
Body
What the user typed. Form and choice answers are understood from plain text.
Your stable conversation key, e.g. telegram:12345 or wa:+628123. Reuse it to continue a conversation. Omit to start a new one; the generated key is returned.
200URLs of uploaded files (see /external/upload)
Optional structured form answers keyed by next_step.form_fields[].field
Forget the workflow position and partial answers before this message
Client UTC offset in minutes, e.g. 420 for UTC+7
Max wait for the reply. The turn keeps running after a timeout.
1 <= x <= 1800Response
SSE stream
The response is of type string.