Conversations
List conversation messages
Messages in this thread, newest first, across every channel it has carried. Reply with POST /v1/messages, passing the conversation’s senderId as the Zavu-Sender header so the answer leaves from the number the contact already knows.
GET
/
v1
/
conversations
/
{conversationId}
/
messages
List conversation messages
curl --request GET \
--url https://api.zavu.dev/v1/conversations/{conversationId}/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/conversations/{conversationId}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/v1/conversations/{conversationId}/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.zavu.dev/v1/conversations/{conversationId}/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://api.zavu.dev/v1/conversations/{conversationId}/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://api.zavu.dev/v1/conversations/{conversationId}/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/conversations/{conversationId}/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{
"items": [
{
"id": "jd7x2k3m4n5p6q7r8s9t0",
"to": "+56912345678",
"createdAt": "2023-11-07T05:31:56Z",
"from": "+13125551212",
"senderId": "sender_12345",
"text": "<string>",
"content": {
"mediaUrl": "https://example.com/image.jpg",
"mediaId": "<string>",
"mimeType": "image/jpeg",
"filename": "invoice.pdf",
"latitude": 123,
"longitude": 123,
"locationName": "<string>",
"locationAddress": "<string>",
"contacts": [
{
"name": "<string>",
"phones": [
"<string>"
]
}
],
"buttons": [
{
"id": "<string>",
"title": "<string>"
}
],
"listButton": "<string>",
"sections": [
{
"title": "<string>",
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
]
}
],
"ctaDisplayText": "See Dates",
"ctaUrl": "https://example.com/schedule",
"ctaHeaderText": "<string>",
"ctaHeaderMediaUrl": "<string>",
"footerText": "Dates subject to change.",
"emoji": "<string>",
"reactToMessageId": "<string>",
"replyToMessageId": "<string>",
"replyToProviderMessageId": "<string>",
"replyToFrom": "<string>",
"replyToText": "<string>",
"replyToMessageType": "<string>",
"templateId": "<string>",
"templateVariables": {
"1": "John",
"2": "ORD-12345"
},
"templateButtonVariables": {
"0": "abc-report-token"
},
"templateHeaderVariables": {
"1": "Jorge y Laura"
}
},
"conversationId": "js723987cyghwqxxaxcf590qd18axd95",
"providerMessageId": "<string>",
"errorCode": "<string>",
"errorMessage": "<string>",
"cost": 123,
"costProvider": 123,
"costTotal": 123,
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"nextCursor": "<string>"
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Required range:
x <= 100Opaque cursor from a previous response's nextCursor.
⌘I
List conversation messages
curl --request GET \
--url https://api.zavu.dev/v1/conversations/{conversationId}/messages \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/conversations/{conversationId}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/v1/conversations/{conversationId}/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.zavu.dev/v1/conversations/{conversationId}/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://api.zavu.dev/v1/conversations/{conversationId}/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://api.zavu.dev/v1/conversations/{conversationId}/messages")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/conversations/{conversationId}/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{
"items": [
{
"id": "jd7x2k3m4n5p6q7r8s9t0",
"to": "+56912345678",
"createdAt": "2023-11-07T05:31:56Z",
"from": "+13125551212",
"senderId": "sender_12345",
"text": "<string>",
"content": {
"mediaUrl": "https://example.com/image.jpg",
"mediaId": "<string>",
"mimeType": "image/jpeg",
"filename": "invoice.pdf",
"latitude": 123,
"longitude": 123,
"locationName": "<string>",
"locationAddress": "<string>",
"contacts": [
{
"name": "<string>",
"phones": [
"<string>"
]
}
],
"buttons": [
{
"id": "<string>",
"title": "<string>"
}
],
"listButton": "<string>",
"sections": [
{
"title": "<string>",
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
]
}
],
"ctaDisplayText": "See Dates",
"ctaUrl": "https://example.com/schedule",
"ctaHeaderText": "<string>",
"ctaHeaderMediaUrl": "<string>",
"footerText": "Dates subject to change.",
"emoji": "<string>",
"reactToMessageId": "<string>",
"replyToMessageId": "<string>",
"replyToProviderMessageId": "<string>",
"replyToFrom": "<string>",
"replyToText": "<string>",
"replyToMessageType": "<string>",
"templateId": "<string>",
"templateVariables": {
"1": "John",
"2": "ORD-12345"
},
"templateButtonVariables": {
"0": "abc-report-token"
},
"templateHeaderVariables": {
"1": "Jorge y Laura"
}
},
"conversationId": "js723987cyghwqxxaxcf590qd18axd95",
"providerMessageId": "<string>",
"errorCode": "<string>",
"errorMessage": "<string>",
"cost": 123,
"costProvider": 123,
"costTotal": 123,
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"nextCursor": "<string>"
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}