Poll public Agent conversation messages
curl --request GET \
--url https://api.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/messages \
--header 'X-Conversation-Token: <x-conversation-token>'import requests
url = "https://api.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/messages"
headers = {"X-Conversation-Token": "<x-conversation-token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Conversation-Token': '<x-conversation-token>'}};
fetch('https://api.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/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.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/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-Conversation-Token: <x-conversation-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.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Conversation-Token", "<x-conversation-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.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/messages")
.header("X-Conversation-Token", "<x-conversation-token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Conversation-Token"] = '<x-conversation-token>'
response = http.request(request)
puts response.read_body{
"data": {
"handoff": {
"status": "unavailable",
"available": true,
"can_request": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trigger": "explicit_request",
"reason": "<string>",
"review_url": "<string>",
"offered_at": "2023-11-07T05:31:56Z",
"requested_at": "2023-11-07T05:31:56Z",
"joined_at": "2023-11-07T05:31:56Z"
},
"lead_capture": {
"version": 1,
"timing": "required_before_chat",
"fields": [
"name"
],
"contact_requirement": "either",
"state": "ready",
"input_schema": {},
"default_phone_country": "<string>",
"request_message": "<string>",
"success_with_name": "<string>",
"success_without_name": "<string>",
"requires_consent": true,
"consent_text": "<string>",
"privacy_url": "<string>",
"captured": true,
"success_message": "<string>"
},
"follow_up": {
"enabled": true,
"opted_out": true,
"status": "scheduled"
},
"analytics_events": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "opened",
"protocol": "web",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"capability_id": "<string>",
"page_context": "<string>"
}
],
"protocol_contract": {
"version": "2026-08-05",
"protocol": "web",
"states": {},
"review": {
"contactbutton_owned": true,
"external_client_can_approve": true,
"external_client_receives_otp": false,
"material_actions_require_verification": true
}
}
},
"meta": {
"request_id": "<string>",
"next_cursor": "<string>"
}
}Poll public Agent conversation messages
GET
/
public
/
agents
/
{agent}
/
conversations
/
{conversation}
/
messages
Poll public Agent conversation messages
curl --request GET \
--url https://api.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/messages \
--header 'X-Conversation-Token: <x-conversation-token>'import requests
url = "https://api.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/messages"
headers = {"X-Conversation-Token": "<x-conversation-token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Conversation-Token': '<x-conversation-token>'}};
fetch('https://api.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/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.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/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-Conversation-Token: <x-conversation-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.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Conversation-Token", "<x-conversation-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.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/messages")
.header("X-Conversation-Token", "<x-conversation-token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contactbutton.com/v1/public/agents/{agent}/conversations/{conversation}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Conversation-Token"] = '<x-conversation-token>'
response = http.request(request)
puts response.read_body{
"data": {
"handoff": {
"status": "unavailable",
"available": true,
"can_request": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trigger": "explicit_request",
"reason": "<string>",
"review_url": "<string>",
"offered_at": "2023-11-07T05:31:56Z",
"requested_at": "2023-11-07T05:31:56Z",
"joined_at": "2023-11-07T05:31:56Z"
},
"lead_capture": {
"version": 1,
"timing": "required_before_chat",
"fields": [
"name"
],
"contact_requirement": "either",
"state": "ready",
"input_schema": {},
"default_phone_country": "<string>",
"request_message": "<string>",
"success_with_name": "<string>",
"success_without_name": "<string>",
"requires_consent": true,
"consent_text": "<string>",
"privacy_url": "<string>",
"captured": true,
"success_message": "<string>"
},
"follow_up": {
"enabled": true,
"opted_out": true,
"status": "scheduled"
},
"analytics_events": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "opened",
"protocol": "web",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"capability_id": "<string>",
"page_context": "<string>"
}
],
"protocol_contract": {
"version": "2026-08-05",
"protocol": "web",
"states": {},
"review": {
"contactbutton_owned": true,
"external_client_can_approve": true,
"external_client_receives_otp": false,
"material_actions_require_verification": true
}
}
},
"meta": {
"request_id": "<string>",
"next_cursor": "<string>"
}
}Headers
Opaque participant token returned only when the conversation is created.
Required string length:
32 - 128Query Parameters
Was this page helpful?