curl --request GET \
--url https://api.closebot.com/botMetric/messages \
--header 'X-CB-KEY: <api-key>'import requests
url = "https://api.closebot.com/botMetric/messages"
headers = {"X-CB-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-CB-KEY': '<api-key>'}};
fetch('https://api.closebot.com/botMetric/messages', 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.closebot.com/botMetric/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-CB-KEY: <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"
"net/http"
"io"
)
func main() {
url := "https://api.closebot.com/botMetric/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CB-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.closebot.com/botMetric/messages")
.header("X-CB-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.closebot.com/botMetric/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CB-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"messageId": "<string>",
"sourceId": "<string>",
"leadId": "<string>",
"fromBot": true,
"direction": "<string>",
"message": "<string>",
"attachments": [
{
"url": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"activities": [
{
"activity": "<string>",
"data": "<string>",
"timeData": "2023-11-07T05:31:56Z",
"faviconUrl": "<string>"
}
],
"botId": "<string>",
"personaId": "<string>",
"channel": "<string>",
"turnSentiment": 123,
"conversationSentiment": 123,
"responderName": "<string>",
"responderIconUrl": "<string>",
"aiVisible": true,
"authorAccountId": "<string>"
}
]Get messages
curl --request GET \
--url https://api.closebot.com/botMetric/messages \
--header 'X-CB-KEY: <api-key>'import requests
url = "https://api.closebot.com/botMetric/messages"
headers = {"X-CB-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-CB-KEY': '<api-key>'}};
fetch('https://api.closebot.com/botMetric/messages', 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.closebot.com/botMetric/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-CB-KEY: <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"
"net/http"
"io"
)
func main() {
url := "https://api.closebot.com/botMetric/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CB-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.closebot.com/botMetric/messages")
.header("X-CB-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.closebot.com/botMetric/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CB-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"messageId": "<string>",
"sourceId": "<string>",
"leadId": "<string>",
"fromBot": true,
"direction": "<string>",
"message": "<string>",
"attachments": [
{
"url": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"activities": [
{
"activity": "<string>",
"data": "<string>",
"timeData": "2023-11-07T05:31:56Z",
"faviconUrl": "<string>"
}
],
"botId": "<string>",
"personaId": "<string>",
"channel": "<string>",
"turnSentiment": 123,
"conversationSentiment": 123,
"responderName": "<string>",
"responderIconUrl": "<string>",
"aiVisible": true,
"authorAccountId": "<string>"
}
]Authorizations
CloseBot API Key Authorization
Query Parameters
Optional source ID.
Optional lead ID.
Optional start date.
Optional end date.
Optional maximum number of messages to return.
Response
OK
The unique ID of the message
The ID of the source
The ID of the lead
Whether the message was sent from the bot
The direction of the message (inbound or outbound)
The content of the message
The list of attachments associated with the message
Show child attributes
Show child attributes
The timestamp when the message was sent
The list of activities associated with the message
Show child attributes
Show child attributes
The optional ID of the bot
The optional ID of the persona
The optional channel of the message
Turn Sentiment: the lexicon's reading of this message's own words, an
integer 0–100 (higher = more positive). Populated only on inbound lead
messages. 50 means no signal; null means not yet computed.
Conversation Sentiment: the mean of the last 10 Turn Sentiments for this
lead as of this message, on the same 0–100 scale. null where not
yet computed.
The display name of the human responder (external messages and notes)
The avatar URL of the human responder (external messages and notes)
For notes (direction "note"): whether the AI can see the note
For notes (direction "note"): the account ID of the note's author. Null for notes created before authorship was tracked.

