curl --request POST \
--url https://api.pingmee.co.il/getMessages \
--header 'Content-Type: application/json' \
--header 'Cookie: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"phoneNumberId": "<string>",
"targetPhoneNumberId": "<string>"
}
'import requests
url = "https://api.pingmee.co.il/getMessages"
payload = {
"phoneNumberId": "<string>",
"targetPhoneNumberId": "<string>"
}
headers = {
"Cookie": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Cookie: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({phoneNumberId: '<string>', targetPhoneNumberId: '<string>'})
};
fetch('https://api.pingmee.co.il/getMessages', 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.pingmee.co.il/getMessages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumberId' => '<string>',
'targetPhoneNumberId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Cookie: <api-key>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pingmee.co.il/getMessages"
payload := strings.NewReader("{\n \"phoneNumberId\": \"<string>\",\n \"targetPhoneNumberId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Cookie", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pingmee.co.il/getMessages")
.header("Cookie", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumberId\": \"<string>\",\n \"targetPhoneNumberId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pingmee.co.il/getMessages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Cookie"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumberId\": \"<string>\",\n \"targetPhoneNumberId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"dbObject": [
{
"messageId": "<string>",
"createdAt": 123,
"sender": "<string>",
"receiver": "<string>",
"initiator": "<string>",
"status": "<string>",
"updatedAt": 123,
"participantsIdentifiers": "<string>",
"message": "<string>",
"type": "<string>",
"messagePlatform": "<string>",
"creationPlatform": "<string>",
"associatedTo": "<string>",
"messageDirection": "<string>",
"hasReaction": true,
"hasAttachment": true,
"translation": {},
"error": {},
"agentIdentification": {},
"context": {
"from": "<string>",
"id": "<string>"
},
"comment": {},
"attachment": {},
"attachmentBase64": {
"resourceId": "<string>",
"fileName": "<string>",
"fileMimeType": "<string>",
"fileSize": 123,
"fileType": "<string>"
},
"reactions": [
{}
],
"richContent": {},
"informativeMessageType": "<string>"
}
],
"hasMoreItemsToFetch": true,
"lastEvaluatedKey": {
"messageId": "<string>",
"createdAt": 123
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Get Messages
Fetches messages for a conversation identified by the business phone number and the customer (target) phone number. Results are ordered newest first. Omit startKey on the first request. For each following batch, set startKey to the lastEvaluatedKey value returned by the previous response.
curl --request POST \
--url https://api.pingmee.co.il/getMessages \
--header 'Content-Type: application/json' \
--header 'Cookie: <api-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"phoneNumberId": "<string>",
"targetPhoneNumberId": "<string>"
}
'import requests
url = "https://api.pingmee.co.il/getMessages"
payload = {
"phoneNumberId": "<string>",
"targetPhoneNumberId": "<string>"
}
headers = {
"Cookie": "<api-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Cookie: '<api-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({phoneNumberId: '<string>', targetPhoneNumberId: '<string>'})
};
fetch('https://api.pingmee.co.il/getMessages', 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.pingmee.co.il/getMessages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumberId' => '<string>',
'targetPhoneNumberId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Cookie: <api-key>",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pingmee.co.il/getMessages"
payload := strings.NewReader("{\n \"phoneNumberId\": \"<string>\",\n \"targetPhoneNumberId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Cookie", "<api-key>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pingmee.co.il/getMessages")
.header("Cookie", "<api-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumberId\": \"<string>\",\n \"targetPhoneNumberId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pingmee.co.il/getMessages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Cookie"] = '<api-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumberId\": \"<string>\",\n \"targetPhoneNumberId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"dbObject": [
{
"messageId": "<string>",
"createdAt": 123,
"sender": "<string>",
"receiver": "<string>",
"initiator": "<string>",
"status": "<string>",
"updatedAt": 123,
"participantsIdentifiers": "<string>",
"message": "<string>",
"type": "<string>",
"messagePlatform": "<string>",
"creationPlatform": "<string>",
"associatedTo": "<string>",
"messageDirection": "<string>",
"hasReaction": true,
"hasAttachment": true,
"translation": {},
"error": {},
"agentIdentification": {},
"context": {
"from": "<string>",
"id": "<string>"
},
"comment": {},
"attachment": {},
"attachmentBase64": {
"resourceId": "<string>",
"fileName": "<string>",
"fileMimeType": "<string>",
"fileSize": 123,
"fileType": "<string>"
},
"reactions": [
{}
],
"richContent": {},
"informativeMessageType": "<string>"
}
],
"hasMoreItemsToFetch": true,
"lastEvaluatedKey": {
"messageId": "<string>",
"createdAt": 123
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}startKey. To fetch the next batch, take lastEvaluatedKey from the previous response and send it as startKey in the next request. That object has the shape { "messageId": "<string>", "createdAt": <number> } (Unix time in milliseconds).Authorizations
Personal access token from Pingmee Settings → Developer Tools
Business API key from Pingmee Settings → Developer Tools
Body
Use startKey only after the first page: set it to lastEvaluatedKey from the prior response to fetch the next batch.
Business / sender phone number ID
Customer (other party) phone number ID
Pagination cursor. Returned as lastEvaluatedKey in the response; send the same object as startKey on the next request to load the next batch. Shape: { "messageId": "<string>", "createdAt": <number> } (Unix milliseconds). Omit startKey on the first request.
Show child attributes
Show child attributes
Response
Messages and pagination metadata
Messages (newest first), each a prepared Message object
Show child attributes
Show child attributes
Whether more messages exist beyond this page
When present, use this value as startKey in the next request to fetch the next batch of (older) messages.
Show child attributes
Show child attributes
Was this page helpful?