Find messages by query
curl --request GET \
--url https://api.gleap.io/v3/messages \
--header 'Authorization: Bearer <token>' \
--header 'project: <project>'import requests
url = "https://api.gleap.io/v3/messages"
headers = {
"project": "<project>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {project: '<project>', Authorization: 'Bearer <token>'}
};
fetch('https://api.gleap.io/v3/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.gleap.io/v3/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>",
"project: <project>"
],
]);
$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.gleap.io/v3/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("project", "<project>")
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.gleap.io/v3/messages")
.header("project", "<project>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gleap.io/v3/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["project"] = '<project>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"_id": "507f1f77bcf86cd799439015",
"id": "507f1f77bcf86cd799439015",
"ticket": "507f1f77bcf86cd799439011",
"comment": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This is a sample message content."
}
]
}
]
},
"type": "COMMENT",
"bot": false,
"user": {
"_id": "507f1f77bcf86cd799439012",
"email": "support@example.com",
"firstName": "John",
"lastName": "Doe"
},
"session": {
"_id": "507f1f77bcf86cd799439013",
"email": "user@example.com"
},
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"index": 0
},
{
"_id": "507f1f77bcf86cd799439016",
"id": "507f1f77bcf86cd799439016",
"ticket": "507f1f77bcf86cd799439011",
"comment": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for the update!"
}
]
}
]
},
"type": "COMMENT",
"bot": false,
"user": {
"_id": "507f1f77bcf86cd799439017",
"email": "user@example.com",
"firstName": "Jane",
"lastName": "Smith"
},
"session": {
"_id": "507f1f77bcf86cd799439013",
"email": "user@example.com"
},
"createdAt": "2024-01-15T11:00:00.000Z",
"updatedAt": "2024-01-15T11:00:00.000Z",
"index": 1
}
]Messages
Find messages by query
Get messages by query with support for filtering, sorting, and pagination.
Filtering:
- Filter by ticket:
ticket=507f1f77bcf86cd799439011 - Filter by type:
type=COMMENTortype=COMMENT,NOTE - Filter by bot messages:
bot=trueorbot=false - Filter by date range:
createdAt>=2024-01-01&createdAt<=2024-12-31
Sorting:
- Sort by creation date:
sort=-createdAt(newest first) orsort=createdAt(oldest first) - Sort by updated date:
sort=-updatedAt
Pagination:
- Limit results:
limit=50(default up to 10000) - Skip results:
skip=0(for pagination:skip=(page-1)*limit)
Translation:
- Auto-translate messages:
language=es(language code for target language)
GET
/
messages
Find messages by query
curl --request GET \
--url https://api.gleap.io/v3/messages \
--header 'Authorization: Bearer <token>' \
--header 'project: <project>'import requests
url = "https://api.gleap.io/v3/messages"
headers = {
"project": "<project>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {project: '<project>', Authorization: 'Bearer <token>'}
};
fetch('https://api.gleap.io/v3/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.gleap.io/v3/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>",
"project: <project>"
],
]);
$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.gleap.io/v3/messages"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("project", "<project>")
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.gleap.io/v3/messages")
.header("project", "<project>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gleap.io/v3/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["project"] = '<project>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"_id": "507f1f77bcf86cd799439015",
"id": "507f1f77bcf86cd799439015",
"ticket": "507f1f77bcf86cd799439011",
"comment": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "This is a sample message content."
}
]
}
]
},
"type": "COMMENT",
"bot": false,
"user": {
"_id": "507f1f77bcf86cd799439012",
"email": "support@example.com",
"firstName": "John",
"lastName": "Doe"
},
"session": {
"_id": "507f1f77bcf86cd799439013",
"email": "user@example.com"
},
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z",
"index": 0
},
{
"_id": "507f1f77bcf86cd799439016",
"id": "507f1f77bcf86cd799439016",
"ticket": "507f1f77bcf86cd799439011",
"comment": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Thank you for the update!"
}
]
}
]
},
"type": "COMMENT",
"bot": false,
"user": {
"_id": "507f1f77bcf86cd799439017",
"email": "user@example.com",
"firstName": "Jane",
"lastName": "Smith"
},
"session": {
"_id": "507f1f77bcf86cd799439013",
"email": "user@example.com"
},
"createdAt": "2024-01-15T11:00:00.000Z",
"updatedAt": "2024-01-15T11:00:00.000Z",
"index": 1
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Query Parameters
- Maximum number of messages to return (default: no limit, max: 10000)
Response
200 - application/json
Ok
⌘I