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>",
"botId": "<string>",
"personaId": "<string>",
"channel": "<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>"
}
]
}
]BotMetric
Get messages
GET
/
botMetric
/
messages
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>",
"botId": "<string>",
"personaId": "<string>",
"channel": "<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>"
}
]
}
]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
Success
The unique ID of the message
The ID of the source
The ID of the lead
The optional ID of the bot
The optional ID of the persona
The optional channel of the message
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

