Chat With Chatbot With Streaming
curl --request POST \
--url https://api.droxy.ai/v1/chatbot/chat-stream \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"chatbotId": "<string>",
"conversation": [
{
"text": "<string>",
"fromUser": true
}
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({chatbotId: '<string>', conversation: [{text: '<string>', fromUser: true}]})
};
fetch('https://api.droxy.ai/v1/chatbot/chat-stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.droxy.ai/v1/chatbot/chat-stream"
payload = {
"chatbotId": "<string>",
"conversation": [
{
"text": "<string>",
"fromUser": True
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.droxy.ai/v1/chatbot/chat-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([
'chatbotId' => '<string>',
'conversation' => [
[
'text' => '<string>',
'fromUser' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.droxy.ai/v1/chatbot/chat-stream")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatbotId\": \"<string>\",\n \"conversation\": [\n {\n \"text\": \"<string>\",\n \"fromUser\": true\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.droxy.ai/v1/chatbot/chat-stream"
payload := strings.NewReader("{\n \"chatbotId\": \"<string>\",\n \"conversation\": [\n {\n \"text\": \"<string>\",\n \"fromUser\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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))
}{
"data": {
"text": "<string>"
},
"type": "<string>",
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}{
"statusCode": 123,
"message": [
"<string>"
],
"error": "<string>"
}{
"statusCode": 123,
"message": [
"<string>"
],
"error": "<string>"
}{
"statusCode": 123,
"message": [
"<string>"
],
"error": "<string>"
}{
"statusCode": 123,
"message": [
"<string>"
],
"error": "<string>"
}{
"statusCode": 123,
"message": [
"<string>"
],
"error": "<string>"
}Chatbot
Chat With Chatbot With Streaming
Ask anything to your chatbot with response streaming.
POST
/
v1
/
chatbot
/
chat-stream
Chat With Chatbot With Streaming
curl --request POST \
--url https://api.droxy.ai/v1/chatbot/chat-stream \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"chatbotId": "<string>",
"conversation": [
{
"text": "<string>",
"fromUser": true
}
]
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({chatbotId: '<string>', conversation: [{text: '<string>', fromUser: true}]})
};
fetch('https://api.droxy.ai/v1/chatbot/chat-stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.droxy.ai/v1/chatbot/chat-stream"
payload = {
"chatbotId": "<string>",
"conversation": [
{
"text": "<string>",
"fromUser": True
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.droxy.ai/v1/chatbot/chat-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([
'chatbotId' => '<string>',
'conversation' => [
[
'text' => '<string>',
'fromUser' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.droxy.ai/v1/chatbot/chat-stream")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatbotId\": \"<string>\",\n \"conversation\": [\n {\n \"text\": \"<string>\",\n \"fromUser\": true\n }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.droxy.ai/v1/chatbot/chat-stream"
payload := strings.NewReader("{\n \"chatbotId\": \"<string>\",\n \"conversation\": [\n {\n \"text\": \"<string>\",\n \"fromUser\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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))
}{
"data": {
"text": "<string>"
},
"type": "<string>",
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}{
"statusCode": 123,
"message": [
"<string>"
],
"error": "<string>"
}{
"statusCode": 123,
"message": [
"<string>"
],
"error": "<string>"
}{
"statusCode": 123,
"message": [
"<string>"
],
"error": "<string>"
}{
"statusCode": 123,
"message": [
"<string>"
],
"error": "<string>"
}{
"statusCode": 123,
"message": [
"<string>"
],
"error": "<string>"
}Authorizations
Body
application/json
Response
Created
The partial streaming response data.
Show child attributes
Show child attributes
The streaming event type. Values can be 'partialResponse' | 'streamEnd' | 'error'.
Error status code. (Only defined when an error occurs while streaming)
Error message. (Only defined when an error occurs while streaming)
Source of the error. (Only defined when an error occurs while streaming)
⌘I