Conversations
List a conversation's messages
Returns one page of a conversation’s messages, both directions, newest first by default (order_by created_at asc reads it oldest first, as a thread shows it). Each message has its full body.
GET
/
conversations
/
{conversation_id}
/
messages
List a conversation's messages
curl --request GET \
--url https://api.axilio.ai/api/v1/conversations/{conversation_id}/messages \
--header 'X-Axilio-Api-Key: <api-key>'import requests
url = "https://api.axilio.ai/api/v1/conversations/{conversation_id}/messages"
headers = {"X-Axilio-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Axilio-Api-Key': '<api-key>'}};
fetch('https://api.axilio.ai/api/v1/conversations/{conversation_id}/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.axilio.ai/api/v1/conversations/{conversation_id}/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-Axilio-Api-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.axilio.ai/api/v1/conversations/{conversation_id}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Axilio-Api-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.axilio.ai/api/v1/conversations/{conversation_id}/messages")
.header("X-Axilio-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.axilio.ai/api/v1/conversations/{conversation_id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Axilio-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"messages": [
{
"body": "<string>",
"channel": "sms",
"conversation_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"direction": "inbound",
"from": "<string>",
"id": "<string>",
"is_group": true,
"parts": [
{
"type": "text",
"file_id": "<string>",
"mime_type": "<string>",
"name": "<string>",
"size_bytes": 123,
"text": "<string>"
}
],
"phone_id": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"to": [
"<string>"
],
"truncated": true,
"accepted_at": "2023-11-07T05:31:56Z",
"api_key_id": "<string>",
"deleted_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"error_code": "phone_unreachable",
"failed_at": "2023-11-07T05:31:56Z",
"phone_deletion": {
"next_check_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"status": "pending"
},
"status": "queued",
"user_id": "<string>"
}
],
"total": 123
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Minimum role required: Viewer
Authorizations
Customer API key (axl_ prefix).
Path Parameters
conversation identifier
Query Parameters
max items per page
Required range:
1 <= x <= 100pagination offset
Required range:
x >= 0Sort expression 'created_at [asc|desc]': when the platform stored each message, newest first by default.
Pattern:
^created_at( (asc|desc))?$⌘I
List a conversation's messages
curl --request GET \
--url https://api.axilio.ai/api/v1/conversations/{conversation_id}/messages \
--header 'X-Axilio-Api-Key: <api-key>'import requests
url = "https://api.axilio.ai/api/v1/conversations/{conversation_id}/messages"
headers = {"X-Axilio-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Axilio-Api-Key': '<api-key>'}};
fetch('https://api.axilio.ai/api/v1/conversations/{conversation_id}/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.axilio.ai/api/v1/conversations/{conversation_id}/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-Axilio-Api-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.axilio.ai/api/v1/conversations/{conversation_id}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Axilio-Api-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.axilio.ai/api/v1/conversations/{conversation_id}/messages")
.header("X-Axilio-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.axilio.ai/api/v1/conversations/{conversation_id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Axilio-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"messages": [
{
"body": "<string>",
"channel": "sms",
"conversation_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"direction": "inbound",
"from": "<string>",
"id": "<string>",
"is_group": true,
"parts": [
{
"type": "text",
"file_id": "<string>",
"mime_type": "<string>",
"name": "<string>",
"size_bytes": 123,
"text": "<string>"
}
],
"phone_id": "<string>",
"received_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"to": [
"<string>"
],
"truncated": true,
"accepted_at": "2023-11-07T05:31:56Z",
"api_key_id": "<string>",
"deleted_at": "2023-11-07T05:31:56Z",
"delivered_at": "2023-11-07T05:31:56Z",
"error": "<string>",
"error_code": "phone_unreachable",
"failed_at": "2023-11-07T05:31:56Z",
"phone_deletion": {
"next_check_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"status": "pending"
},
"status": "queued",
"user_id": "<string>"
}
],
"total": 123
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}