Cursor-paginated raw message export
curl --request GET \
--url https://{subdomain}.mihu.ai/api/v1/analytics/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://{subdomain}.mihu.ai/api/v1/analytics/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{subdomain}.mihu.ai/api/v1/analytics/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://{subdomain}.mihu.ai/api/v1/analytics/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 => [
"Authorization: Bearer <token>"
],
]);
$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://{subdomain}.mihu.ai/api/v1/analytics/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{subdomain}.mihu.ai/api/v1/analytics/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/analytics/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"meta": {},
"messages": [
{
"message_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "whatsapp",
"channel_label": "Whatsapp",
"sender": "<string>",
"message_type": "<string>",
"content": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"next_cursor": "<string>",
"has_more": true,
"limit": 123
}
}Analytics
Cursor-paginated raw message export
Returns one row per message in [from, to). Subject to workspace policy: when ANALYTICS_MESSAGES_EXPORT=disabled the endpoint returns 403; when ‘masked’ the content field is replaced with ’***’. Sort order is (created_at ASC, message_uuid ASC).
GET
/
api
/
v1
/
analytics
/
messages
Cursor-paginated raw message export
curl --request GET \
--url https://{subdomain}.mihu.ai/api/v1/analytics/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://{subdomain}.mihu.ai/api/v1/analytics/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{subdomain}.mihu.ai/api/v1/analytics/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://{subdomain}.mihu.ai/api/v1/analytics/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 => [
"Authorization: Bearer <token>"
],
]);
$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://{subdomain}.mihu.ai/api/v1/analytics/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{subdomain}.mihu.ai/api/v1/analytics/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/analytics/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"meta": {},
"messages": [
{
"message_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contact_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "whatsapp",
"channel_label": "Whatsapp",
"sender": "<string>",
"message_type": "<string>",
"content": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"next_cursor": "<string>",
"has_more": true,
"limit": 123
}
}Authorizations
Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"
Query Parameters
Example:
"whatsapp"
1..1000, default 500
Required range:
1 <= x <= 1000Opaque cursor from a previous response's pagination.next_cursor
⌘I
