Create Conversation
curl --request POST \
--url https://api.chat-dash.com/v1/public/agents/{agentId}/conversations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"platformId": "<string>",
"leadId": "<string>",
"name": "<string>",
"read": false,
"endedAt": "2023-11-07T05:31:56Z",
"browser": "<string>",
"device": "<string>",
"os": "<string>",
"countryCode": "<string>",
"ipAddress": "<string>",
"record": false,
"interacted": false,
"channel": "<string>",
"phone": "<string>",
"phoneSecondary": "<string>",
"instagramId": "<string>",
"instagramUsername": "<string>",
"cost": 123,
"duration": 123,
"url": "<string>",
"endedReason": "<string>",
"noAnswer": true,
"status": "ai",
"liveAgentName": "<string>",
"liveAgentId": "<string>",
"isLive": false,
"note": "<string>",
"topic": "<string>",
"subtopic": "<string>",
"summary": "<string>",
"evaluation": {
"isSuccess": true,
"reason": "<string>"
},
"mistunderstoodQueries": [
{
"question": "<string>"
}
],
"customAnalysis": {},
"metadata": {}
}
'import requests
url = "https://api.chat-dash.com/v1/public/agents/{agentId}/conversations"
payload = {
"platformId": "<string>",
"leadId": "<string>",
"name": "<string>",
"read": False,
"endedAt": "2023-11-07T05:31:56Z",
"browser": "<string>",
"device": "<string>",
"os": "<string>",
"countryCode": "<string>",
"ipAddress": "<string>",
"record": False,
"interacted": False,
"channel": "<string>",
"phone": "<string>",
"phoneSecondary": "<string>",
"instagramId": "<string>",
"instagramUsername": "<string>",
"cost": 123,
"duration": 123,
"url": "<string>",
"endedReason": "<string>",
"noAnswer": True,
"status": "ai",
"liveAgentName": "<string>",
"liveAgentId": "<string>",
"isLive": False,
"note": "<string>",
"topic": "<string>",
"subtopic": "<string>",
"summary": "<string>",
"evaluation": {
"isSuccess": True,
"reason": "<string>"
},
"mistunderstoodQueries": [{ "question": "<string>" }],
"customAnalysis": {},
"metadata": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
platformId: '<string>',
leadId: '<string>',
name: '<string>',
read: false,
endedAt: '2023-11-07T05:31:56Z',
browser: '<string>',
device: '<string>',
os: '<string>',
countryCode: '<string>',
ipAddress: '<string>',
record: false,
interacted: false,
channel: '<string>',
phone: '<string>',
phoneSecondary: '<string>',
instagramId: '<string>',
instagramUsername: '<string>',
cost: 123,
duration: 123,
url: '<string>',
endedReason: '<string>',
noAnswer: true,
status: 'ai',
liveAgentName: '<string>',
liveAgentId: '<string>',
isLive: false,
note: '<string>',
topic: '<string>',
subtopic: '<string>',
summary: '<string>',
evaluation: {isSuccess: true, reason: '<string>'},
mistunderstoodQueries: [{question: '<string>'}],
customAnalysis: {},
metadata: {}
})
};
fetch('https://api.chat-dash.com/v1/public/agents/{agentId}/conversations', 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.chat-dash.com/v1/public/agents/{agentId}/conversations",
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([
'platformId' => '<string>',
'leadId' => '<string>',
'name' => '<string>',
'read' => false,
'endedAt' => '2023-11-07T05:31:56Z',
'browser' => '<string>',
'device' => '<string>',
'os' => '<string>',
'countryCode' => '<string>',
'ipAddress' => '<string>',
'record' => false,
'interacted' => false,
'channel' => '<string>',
'phone' => '<string>',
'phoneSecondary' => '<string>',
'instagramId' => '<string>',
'instagramUsername' => '<string>',
'cost' => 123,
'duration' => 123,
'url' => '<string>',
'endedReason' => '<string>',
'noAnswer' => true,
'status' => 'ai',
'liveAgentName' => '<string>',
'liveAgentId' => '<string>',
'isLive' => false,
'note' => '<string>',
'topic' => '<string>',
'subtopic' => '<string>',
'summary' => '<string>',
'evaluation' => [
'isSuccess' => true,
'reason' => '<string>'
],
'mistunderstoodQueries' => [
[
'question' => '<string>'
]
],
'customAnalysis' => [
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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.chat-dash.com/v1/public/agents/{agentId}/conversations"
payload := strings.NewReader("{\n \"platformId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"name\": \"<string>\",\n \"read\": false,\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"browser\": \"<string>\",\n \"device\": \"<string>\",\n \"os\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"record\": false,\n \"interacted\": false,\n \"channel\": \"<string>\",\n \"phone\": \"<string>\",\n \"phoneSecondary\": \"<string>\",\n \"instagramId\": \"<string>\",\n \"instagramUsername\": \"<string>\",\n \"cost\": 123,\n \"duration\": 123,\n \"url\": \"<string>\",\n \"endedReason\": \"<string>\",\n \"noAnswer\": true,\n \"status\": \"ai\",\n \"liveAgentName\": \"<string>\",\n \"liveAgentId\": \"<string>\",\n \"isLive\": false,\n \"note\": \"<string>\",\n \"topic\": \"<string>\",\n \"subtopic\": \"<string>\",\n \"summary\": \"<string>\",\n \"evaluation\": {\n \"isSuccess\": true,\n \"reason\": \"<string>\"\n },\n \"mistunderstoodQueries\": [\n {\n \"question\": \"<string>\"\n }\n ],\n \"customAnalysis\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.chat-dash.com/v1/public/agents/{agentId}/conversations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"platformId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"name\": \"<string>\",\n \"read\": false,\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"browser\": \"<string>\",\n \"device\": \"<string>\",\n \"os\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"record\": false,\n \"interacted\": false,\n \"channel\": \"<string>\",\n \"phone\": \"<string>\",\n \"phoneSecondary\": \"<string>\",\n \"instagramId\": \"<string>\",\n \"instagramUsername\": \"<string>\",\n \"cost\": 123,\n \"duration\": 123,\n \"url\": \"<string>\",\n \"endedReason\": \"<string>\",\n \"noAnswer\": true,\n \"status\": \"ai\",\n \"liveAgentName\": \"<string>\",\n \"liveAgentId\": \"<string>\",\n \"isLive\": false,\n \"note\": \"<string>\",\n \"topic\": \"<string>\",\n \"subtopic\": \"<string>\",\n \"summary\": \"<string>\",\n \"evaluation\": {\n \"isSuccess\": true,\n \"reason\": \"<string>\"\n },\n \"mistunderstoodQueries\": [\n {\n \"question\": \"<string>\"\n }\n ],\n \"customAnalysis\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chat-dash.com/v1/public/agents/{agentId}/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"platformId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"name\": \"<string>\",\n \"read\": false,\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"browser\": \"<string>\",\n \"device\": \"<string>\",\n \"os\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"record\": false,\n \"interacted\": false,\n \"channel\": \"<string>\",\n \"phone\": \"<string>\",\n \"phoneSecondary\": \"<string>\",\n \"instagramId\": \"<string>\",\n \"instagramUsername\": \"<string>\",\n \"cost\": 123,\n \"duration\": 123,\n \"url\": \"<string>\",\n \"endedReason\": \"<string>\",\n \"noAnswer\": true,\n \"status\": \"ai\",\n \"liveAgentName\": \"<string>\",\n \"liveAgentId\": \"<string>\",\n \"isLive\": false,\n \"note\": \"<string>\",\n \"topic\": \"<string>\",\n \"subtopic\": \"<string>\",\n \"summary\": \"<string>\",\n \"evaluation\": {\n \"isSuccess\": true,\n \"reason\": \"<string>\"\n },\n \"mistunderstoodQueries\": [\n {\n \"question\": \"<string>\"\n }\n ],\n \"customAnalysis\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "Conversation added successfully",
"conversation": {
"_id": "<string>",
"agentId": "<string>",
"platformId": "<string>",
"leadId": "<string>",
"campaignId": "<string>",
"name": "<string>",
"read": false,
"endedAt": "2023-11-07T05:31:56Z",
"browser": "<string>",
"device": "<string>",
"os": "<string>",
"countryCode": "<string>",
"ipAddress": "<string>",
"record": false,
"interacted": false,
"channel": "<string>",
"phone": "<string>",
"phoneSecondary": "<string>",
"instagramId": "<string>",
"instagramUsername": "<string>",
"cost": 123,
"duration": 123,
"url": "<string>",
"endedReason": "<string>",
"noAnswer": true,
"status": "ai",
"liveAgentName": "<string>",
"liveAgentId": "<string>",
"isLive": false,
"note": "<string>",
"topic": "<string>",
"subtopic": "<string>",
"summary": "<string>",
"evaluation": {
"isSuccess": true,
"reason": "<string>"
},
"mistunderstoodQueries": [
{
"question": "<string>"
}
],
"customAnalysis": {},
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "An unexpected error occurred"
}Conversations
Create Conversation
Create a new conversation for a agent. For best results, fill in as many of the fields as possible when creating a conversation object.
POST
/
agents
/
{agentId}
/
conversations
Create Conversation
curl --request POST \
--url https://api.chat-dash.com/v1/public/agents/{agentId}/conversations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"platformId": "<string>",
"leadId": "<string>",
"name": "<string>",
"read": false,
"endedAt": "2023-11-07T05:31:56Z",
"browser": "<string>",
"device": "<string>",
"os": "<string>",
"countryCode": "<string>",
"ipAddress": "<string>",
"record": false,
"interacted": false,
"channel": "<string>",
"phone": "<string>",
"phoneSecondary": "<string>",
"instagramId": "<string>",
"instagramUsername": "<string>",
"cost": 123,
"duration": 123,
"url": "<string>",
"endedReason": "<string>",
"noAnswer": true,
"status": "ai",
"liveAgentName": "<string>",
"liveAgentId": "<string>",
"isLive": false,
"note": "<string>",
"topic": "<string>",
"subtopic": "<string>",
"summary": "<string>",
"evaluation": {
"isSuccess": true,
"reason": "<string>"
},
"mistunderstoodQueries": [
{
"question": "<string>"
}
],
"customAnalysis": {},
"metadata": {}
}
'import requests
url = "https://api.chat-dash.com/v1/public/agents/{agentId}/conversations"
payload = {
"platformId": "<string>",
"leadId": "<string>",
"name": "<string>",
"read": False,
"endedAt": "2023-11-07T05:31:56Z",
"browser": "<string>",
"device": "<string>",
"os": "<string>",
"countryCode": "<string>",
"ipAddress": "<string>",
"record": False,
"interacted": False,
"channel": "<string>",
"phone": "<string>",
"phoneSecondary": "<string>",
"instagramId": "<string>",
"instagramUsername": "<string>",
"cost": 123,
"duration": 123,
"url": "<string>",
"endedReason": "<string>",
"noAnswer": True,
"status": "ai",
"liveAgentName": "<string>",
"liveAgentId": "<string>",
"isLive": False,
"note": "<string>",
"topic": "<string>",
"subtopic": "<string>",
"summary": "<string>",
"evaluation": {
"isSuccess": True,
"reason": "<string>"
},
"mistunderstoodQueries": [{ "question": "<string>" }],
"customAnalysis": {},
"metadata": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
platformId: '<string>',
leadId: '<string>',
name: '<string>',
read: false,
endedAt: '2023-11-07T05:31:56Z',
browser: '<string>',
device: '<string>',
os: '<string>',
countryCode: '<string>',
ipAddress: '<string>',
record: false,
interacted: false,
channel: '<string>',
phone: '<string>',
phoneSecondary: '<string>',
instagramId: '<string>',
instagramUsername: '<string>',
cost: 123,
duration: 123,
url: '<string>',
endedReason: '<string>',
noAnswer: true,
status: 'ai',
liveAgentName: '<string>',
liveAgentId: '<string>',
isLive: false,
note: '<string>',
topic: '<string>',
subtopic: '<string>',
summary: '<string>',
evaluation: {isSuccess: true, reason: '<string>'},
mistunderstoodQueries: [{question: '<string>'}],
customAnalysis: {},
metadata: {}
})
};
fetch('https://api.chat-dash.com/v1/public/agents/{agentId}/conversations', 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.chat-dash.com/v1/public/agents/{agentId}/conversations",
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([
'platformId' => '<string>',
'leadId' => '<string>',
'name' => '<string>',
'read' => false,
'endedAt' => '2023-11-07T05:31:56Z',
'browser' => '<string>',
'device' => '<string>',
'os' => '<string>',
'countryCode' => '<string>',
'ipAddress' => '<string>',
'record' => false,
'interacted' => false,
'channel' => '<string>',
'phone' => '<string>',
'phoneSecondary' => '<string>',
'instagramId' => '<string>',
'instagramUsername' => '<string>',
'cost' => 123,
'duration' => 123,
'url' => '<string>',
'endedReason' => '<string>',
'noAnswer' => true,
'status' => 'ai',
'liveAgentName' => '<string>',
'liveAgentId' => '<string>',
'isLive' => false,
'note' => '<string>',
'topic' => '<string>',
'subtopic' => '<string>',
'summary' => '<string>',
'evaluation' => [
'isSuccess' => true,
'reason' => '<string>'
],
'mistunderstoodQueries' => [
[
'question' => '<string>'
]
],
'customAnalysis' => [
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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.chat-dash.com/v1/public/agents/{agentId}/conversations"
payload := strings.NewReader("{\n \"platformId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"name\": \"<string>\",\n \"read\": false,\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"browser\": \"<string>\",\n \"device\": \"<string>\",\n \"os\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"record\": false,\n \"interacted\": false,\n \"channel\": \"<string>\",\n \"phone\": \"<string>\",\n \"phoneSecondary\": \"<string>\",\n \"instagramId\": \"<string>\",\n \"instagramUsername\": \"<string>\",\n \"cost\": 123,\n \"duration\": 123,\n \"url\": \"<string>\",\n \"endedReason\": \"<string>\",\n \"noAnswer\": true,\n \"status\": \"ai\",\n \"liveAgentName\": \"<string>\",\n \"liveAgentId\": \"<string>\",\n \"isLive\": false,\n \"note\": \"<string>\",\n \"topic\": \"<string>\",\n \"subtopic\": \"<string>\",\n \"summary\": \"<string>\",\n \"evaluation\": {\n \"isSuccess\": true,\n \"reason\": \"<string>\"\n },\n \"mistunderstoodQueries\": [\n {\n \"question\": \"<string>\"\n }\n ],\n \"customAnalysis\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.chat-dash.com/v1/public/agents/{agentId}/conversations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"platformId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"name\": \"<string>\",\n \"read\": false,\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"browser\": \"<string>\",\n \"device\": \"<string>\",\n \"os\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"record\": false,\n \"interacted\": false,\n \"channel\": \"<string>\",\n \"phone\": \"<string>\",\n \"phoneSecondary\": \"<string>\",\n \"instagramId\": \"<string>\",\n \"instagramUsername\": \"<string>\",\n \"cost\": 123,\n \"duration\": 123,\n \"url\": \"<string>\",\n \"endedReason\": \"<string>\",\n \"noAnswer\": true,\n \"status\": \"ai\",\n \"liveAgentName\": \"<string>\",\n \"liveAgentId\": \"<string>\",\n \"isLive\": false,\n \"note\": \"<string>\",\n \"topic\": \"<string>\",\n \"subtopic\": \"<string>\",\n \"summary\": \"<string>\",\n \"evaluation\": {\n \"isSuccess\": true,\n \"reason\": \"<string>\"\n },\n \"mistunderstoodQueries\": [\n {\n \"question\": \"<string>\"\n }\n ],\n \"customAnalysis\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chat-dash.com/v1/public/agents/{agentId}/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"platformId\": \"<string>\",\n \"leadId\": \"<string>\",\n \"name\": \"<string>\",\n \"read\": false,\n \"endedAt\": \"2023-11-07T05:31:56Z\",\n \"browser\": \"<string>\",\n \"device\": \"<string>\",\n \"os\": \"<string>\",\n \"countryCode\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"record\": false,\n \"interacted\": false,\n \"channel\": \"<string>\",\n \"phone\": \"<string>\",\n \"phoneSecondary\": \"<string>\",\n \"instagramId\": \"<string>\",\n \"instagramUsername\": \"<string>\",\n \"cost\": 123,\n \"duration\": 123,\n \"url\": \"<string>\",\n \"endedReason\": \"<string>\",\n \"noAnswer\": true,\n \"status\": \"ai\",\n \"liveAgentName\": \"<string>\",\n \"liveAgentId\": \"<string>\",\n \"isLive\": false,\n \"note\": \"<string>\",\n \"topic\": \"<string>\",\n \"subtopic\": \"<string>\",\n \"summary\": \"<string>\",\n \"evaluation\": {\n \"isSuccess\": true,\n \"reason\": \"<string>\"\n },\n \"mistunderstoodQueries\": [\n {\n \"question\": \"<string>\"\n }\n ],\n \"customAnalysis\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "Conversation added successfully",
"conversation": {
"_id": "<string>",
"agentId": "<string>",
"platformId": "<string>",
"leadId": "<string>",
"campaignId": "<string>",
"name": "<string>",
"read": false,
"endedAt": "2023-11-07T05:31:56Z",
"browser": "<string>",
"device": "<string>",
"os": "<string>",
"countryCode": "<string>",
"ipAddress": "<string>",
"record": false,
"interacted": false,
"channel": "<string>",
"phone": "<string>",
"phoneSecondary": "<string>",
"instagramId": "<string>",
"instagramUsername": "<string>",
"cost": 123,
"duration": 123,
"url": "<string>",
"endedReason": "<string>",
"noAnswer": true,
"status": "ai",
"liveAgentName": "<string>",
"liveAgentId": "<string>",
"isLive": false,
"note": "<string>",
"topic": "<string>",
"subtopic": "<string>",
"summary": "<string>",
"evaluation": {
"isSuccess": true,
"reason": "<string>"
},
"mistunderstoodQueries": [
{
"question": "<string>"
}
],
"customAnalysis": {},
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "An unexpected error occurred"
}Headers
Body
application/json
