curl --request GET \
--url http://localhost:3000/chat/{chat_jid}/messages \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://localhost:3000/chat/{chat_jid}/messages"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('http://localhost:3000/chat/{chat_jid}/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_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/chat/{chat_jid}/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: Basic <encoded-value>"
],
]);
$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 := "http://localhost:3000/chat/{chat_jid}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3000/chat/{chat_jid}/messages")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/chat/{chat_jid}/messages")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"code": "SUCCESS",
"message": "Success get chat messages",
"results": {
"data": [
{
"id": "3EB0B430B6F8F1D0E053AC120E0A9E5C",
"chat_jid": "6289685028129@s.whatsapp.net",
"sender_jid": "6289685028129@s.whatsapp.net",
"content": "Hello, how are you?",
"timestamp": "2024-01-15T10:30:00Z",
"is_from_me": false,
"media_type": "image",
"filename": "photo.jpg",
"url": "https://media.example.com/file.jpg",
"file_length": 1024768,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"limit": 50,
"offset": 0,
"total": 1250
},
"chat_info": {
"jid": "6289685028129@s.whatsapp.net",
"name": "John Doe",
"last_message_time": "2024-01-15T10:30:00Z",
"ephemeral_expiration": 0,
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
}{
"code": 400,
"message": "field cannot be blank",
"results": null
}{
"code": 401,
"message": "Unauthorized access",
"results": null
}{
"code": 404,
"message": "Chat not found",
"results": null
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "you are not loggin",
"results": null
}Get messages from a specific chat
Retrieve messages from a specific chat conversation with filtering options
curl --request GET \
--url http://localhost:3000/chat/{chat_jid}/messages \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://localhost:3000/chat/{chat_jid}/messages"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('http://localhost:3000/chat/{chat_jid}/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_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/chat/{chat_jid}/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: Basic <encoded-value>"
],
]);
$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 := "http://localhost:3000/chat/{chat_jid}/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3000/chat/{chat_jid}/messages")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/chat/{chat_jid}/messages")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"code": "SUCCESS",
"message": "Success get chat messages",
"results": {
"data": [
{
"id": "3EB0B430B6F8F1D0E053AC120E0A9E5C",
"chat_jid": "6289685028129@s.whatsapp.net",
"sender_jid": "6289685028129@s.whatsapp.net",
"content": "Hello, how are you?",
"timestamp": "2024-01-15T10:30:00Z",
"is_from_me": false,
"media_type": "image",
"filename": "photo.jpg",
"url": "https://media.example.com/file.jpg",
"file_length": 1024768,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"limit": 50,
"offset": 0,
"total": 1250
},
"chat_info": {
"jid": "6289685028129@s.whatsapp.net",
"name": "John Doe",
"last_message_time": "2024-01-15T10:30:00Z",
"ephemeral_expiration": 0,
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
}{
"code": 400,
"message": "field cannot be blank",
"results": null
}{
"code": 401,
"message": "Unauthorized access",
"results": null
}{
"code": 404,
"message": "Chat not found",
"results": null
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "you are not loggin",
"results": null
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
Chat JID (e.g., phone@s.whatsapp.net for individual or groupid@g.us for group)
Query Parameters
Maximum number of messages to return
x <= 100Number of messages to skip (for pagination)
Filter messages from this timestamp (ISO 8601 format)
Filter messages until this timestamp (ISO 8601 format)
Only return messages with media content
Filter messages by sender (true for messages sent by you, false for received messages). When both media_only=true and isFromMe=false are provided, media_only takes precedence and will return all media messages regardless of sender.
Search messages by content text
