Get Messages
curl --request GET \
--url https://api.puppeteerai.com/threads/{thread_id}/messages \
--header 'Authorization: <authorization>'import requests
url = "https://api.puppeteerai.com/threads/{thread_id}/messages"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.puppeteerai.com/threads/{thread_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.puppeteerai.com/threads/{thread_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 => [
"Authorization: <authorization>"
],
]);
$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.puppeteerai.com/threads/{thread_id}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.puppeteerai.com/threads/{thread_id}/messages")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.puppeteerai.com/threads/{thread_id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"messages": [
{
"message_id": "<string>",
"role": "<string>",
"message": "<string>",
"conversation_id": 123,
"timestamp": 123,
"extras": {},
"conversation_end_time": "<string>"
}
],
"pagination": {
"cursor": "<string>"
},
"is_locked": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Messages
Get Messages
Retrieve messages from a thread using cursor-based pagination.
GET
/
threads
/
{thread_id}
/
messages
Get Messages
curl --request GET \
--url https://api.puppeteerai.com/threads/{thread_id}/messages \
--header 'Authorization: <authorization>'import requests
url = "https://api.puppeteerai.com/threads/{thread_id}/messages"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.puppeteerai.com/threads/{thread_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.puppeteerai.com/threads/{thread_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 => [
"Authorization: <authorization>"
],
]);
$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.puppeteerai.com/threads/{thread_id}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.puppeteerai.com/threads/{thread_id}/messages")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.puppeteerai.com/threads/{thread_id}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"messages": [
{
"message_id": "<string>",
"role": "<string>",
"message": "<string>",
"conversation_id": 123,
"timestamp": 123,
"extras": {},
"conversation_end_time": "<string>"
}
],
"pagination": {
"cursor": "<string>"
},
"is_locked": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Path Parameters
Query Parameters
Base64-encoded pagination cursor. If not provided, returns the latest 20 messages.
Controls the direction of message retrieval. When false (default), returns messages older than the cursor. When true, returns messages newer than the cursor.
Response
Successful Response
List of messages.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
True when the access link locks on conversation end and the latest conversation has ended. The widget must disable input and hide the ended conversation's history.