Busca chats com filtros
curl --request POST \
--url https://api.wppfy.com/chat/find \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"operator": "AND",
"sort": "-wa_lastMsgTimestamp",
"limit": 50,
"offset": 0,
"wa_isGroup": true,
"lead_status": "~novo",
"wa_label": "~importante"
}
'import requests
url = "https://api.wppfy.com/chat/find"
payload = {
"operator": "AND",
"sort": "-wa_lastMsgTimestamp",
"limit": 50,
"offset": 0,
"wa_isGroup": True,
"lead_status": "~novo",
"wa_label": "~importante"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operator: 'AND',
sort: '-wa_lastMsgTimestamp',
limit: 50,
offset: 0,
wa_isGroup: true,
lead_status: '~novo',
wa_label: '~importante'
})
};
fetch('https://api.wppfy.com/chat/find', 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.wppfy.com/chat/find",
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([
'operator' => 'AND',
'sort' => '-wa_lastMsgTimestamp',
'limit' => 50,
'offset' => 0,
'wa_isGroup' => true,
'lead_status' => '~novo',
'wa_label' => '~importante'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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.wppfy.com/chat/find"
payload := strings.NewReader("{\n \"operator\": \"AND\",\n \"sort\": \"-wa_lastMsgTimestamp\",\n \"limit\": 50,\n \"offset\": 0,\n \"wa_isGroup\": true,\n \"lead_status\": \"~novo\",\n \"wa_label\": \"~importante\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<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.wppfy.com/chat/find")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operator\": \"AND\",\n \"sort\": \"-wa_lastMsgTimestamp\",\n \"limit\": 50,\n \"offset\": 0,\n \"wa_isGroup\": true,\n \"lead_status\": \"~novo\",\n \"wa_label\": \"~importante\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/chat/find")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operator\": \"AND\",\n \"sort\": \"-wa_lastMsgTimestamp\",\n \"limit\": 50,\n \"offset\": 0,\n \"wa_isGroup\": true,\n \"lead_status\": \"~novo\",\n \"wa_label\": \"~importante\"\n}"
response = http.request(request)
puts response.read_body{
"chats": [
{
"id": "<string>",
"wa_fastid": "<string>",
"wa_chatid": "<string>",
"wa_archived": false,
"wa_contactName": "",
"wa_name": "",
"name": "",
"image": "",
"imagePreview": "",
"wa_ephemeralExpiration": 0,
"wa_isBlocked": false,
"wa_isGroup": false,
"wa_isGroup_admin": false,
"wa_isGroup_announce": false,
"wa_isGroup_community": false,
"wa_isGroup_member": false,
"wa_isPinned": false,
"wa_label": "[]",
"wa_lastMessageTextVote": "",
"wa_lastMessageType": "",
"wa_lastMsgTimestamp": 0,
"wa_lastMessageSender": "",
"wa_muteEndTime": 0,
"owner": "",
"wa_unreadCount": 0,
"phone": "",
"wa_common_groups": "Grupo Família(120363123456789012@g.us),Trabalho(987654321098765432@g.us)",
"lead_name": "",
"lead_fullName": "",
"lead_email": "",
"lead_personalid": "",
"lead_status": "",
"lead_tags": "<string>",
"lead_notes": "",
"lead_isTicketOpen": false,
"lead_assignedAttendant_id": "",
"lead_kanbanOrder": 0,
"lead_field01": "",
"lead_field02": "",
"lead_field03": "",
"lead_field04": "",
"lead_field05": "",
"lead_field06": "",
"lead_field07": "",
"lead_field08": "",
"lead_field09": "",
"lead_field10": "",
"lead_field11": "",
"lead_field12": "",
"lead_field13": "",
"lead_field14": "",
"lead_field15": "",
"lead_field16": "",
"lead_field17": "",
"lead_field18": "",
"lead_field19": "",
"lead_field20": "",
"chatbot_agentResetMemoryAt": 0,
"chatbot_lastTrigger_id": "",
"chatbot_lastTriggerAt": 0,
"chatbot_disableUntil": 0,
"created": "strftime('%Y-%m-%d %H:%M:%f', 'now')",
"updated": "strftime('%Y-%m-%d %H:%M:%f', 'now')"
}
],
"totalChatsStats": {},
"pagination": {
"totalRecords": 123,
"pageSize": 123,
"currentPage": 123,
"totalPages": 123
}
}Chats
Busca chats com filtros
Busca chats com diversos filtros e ordenação. Suporta filtros em todos os campos do chat, paginação e ordenação customizada.
Operadores de filtro:
~: LIKE (contém)!~: NOT LIKE (não contém)!=: diferente>=: maior ou igual>: maior que<=: menor ou igual<: menor que- Sem operador: LIKE (contém)
POST
/
chat
/
find
Busca chats com filtros
curl --request POST \
--url https://api.wppfy.com/chat/find \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"operator": "AND",
"sort": "-wa_lastMsgTimestamp",
"limit": 50,
"offset": 0,
"wa_isGroup": true,
"lead_status": "~novo",
"wa_label": "~importante"
}
'import requests
url = "https://api.wppfy.com/chat/find"
payload = {
"operator": "AND",
"sort": "-wa_lastMsgTimestamp",
"limit": 50,
"offset": 0,
"wa_isGroup": True,
"lead_status": "~novo",
"wa_label": "~importante"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operator: 'AND',
sort: '-wa_lastMsgTimestamp',
limit: 50,
offset: 0,
wa_isGroup: true,
lead_status: '~novo',
wa_label: '~importante'
})
};
fetch('https://api.wppfy.com/chat/find', 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.wppfy.com/chat/find",
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([
'operator' => 'AND',
'sort' => '-wa_lastMsgTimestamp',
'limit' => 50,
'offset' => 0,
'wa_isGroup' => true,
'lead_status' => '~novo',
'wa_label' => '~importante'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <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.wppfy.com/chat/find"
payload := strings.NewReader("{\n \"operator\": \"AND\",\n \"sort\": \"-wa_lastMsgTimestamp\",\n \"limit\": 50,\n \"offset\": 0,\n \"wa_isGroup\": true,\n \"lead_status\": \"~novo\",\n \"wa_label\": \"~importante\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<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.wppfy.com/chat/find")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operator\": \"AND\",\n \"sort\": \"-wa_lastMsgTimestamp\",\n \"limit\": 50,\n \"offset\": 0,\n \"wa_isGroup\": true,\n \"lead_status\": \"~novo\",\n \"wa_label\": \"~importante\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/chat/find")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operator\": \"AND\",\n \"sort\": \"-wa_lastMsgTimestamp\",\n \"limit\": 50,\n \"offset\": 0,\n \"wa_isGroup\": true,\n \"lead_status\": \"~novo\",\n \"wa_label\": \"~importante\"\n}"
response = http.request(request)
puts response.read_body{
"chats": [
{
"id": "<string>",
"wa_fastid": "<string>",
"wa_chatid": "<string>",
"wa_archived": false,
"wa_contactName": "",
"wa_name": "",
"name": "",
"image": "",
"imagePreview": "",
"wa_ephemeralExpiration": 0,
"wa_isBlocked": false,
"wa_isGroup": false,
"wa_isGroup_admin": false,
"wa_isGroup_announce": false,
"wa_isGroup_community": false,
"wa_isGroup_member": false,
"wa_isPinned": false,
"wa_label": "[]",
"wa_lastMessageTextVote": "",
"wa_lastMessageType": "",
"wa_lastMsgTimestamp": 0,
"wa_lastMessageSender": "",
"wa_muteEndTime": 0,
"owner": "",
"wa_unreadCount": 0,
"phone": "",
"wa_common_groups": "Grupo Família(120363123456789012@g.us),Trabalho(987654321098765432@g.us)",
"lead_name": "",
"lead_fullName": "",
"lead_email": "",
"lead_personalid": "",
"lead_status": "",
"lead_tags": "<string>",
"lead_notes": "",
"lead_isTicketOpen": false,
"lead_assignedAttendant_id": "",
"lead_kanbanOrder": 0,
"lead_field01": "",
"lead_field02": "",
"lead_field03": "",
"lead_field04": "",
"lead_field05": "",
"lead_field06": "",
"lead_field07": "",
"lead_field08": "",
"lead_field09": "",
"lead_field10": "",
"lead_field11": "",
"lead_field12": "",
"lead_field13": "",
"lead_field14": "",
"lead_field15": "",
"lead_field16": "",
"lead_field17": "",
"lead_field18": "",
"lead_field19": "",
"lead_field20": "",
"chatbot_agentResetMemoryAt": 0,
"chatbot_lastTrigger_id": "",
"chatbot_lastTriggerAt": 0,
"chatbot_disableUntil": 0,
"created": "strftime('%Y-%m-%d %H:%M:%f', 'now')",
"updated": "strftime('%Y-%m-%d %H:%M:%f', 'now')"
}
],
"totalChatsStats": {},
"pagination": {
"totalRecords": 123,
"pageSize": 123,
"currentPage": 123,
"totalPages": 123
}
}Autorizações
Corpo
application/json
Operador lógico entre os filtros
Opções disponíveis:
AND, OR Campo para ordenação (+/-campo). Ex -wa_lastMsgTimestamp
Limite de resultados por página
Offset para paginação
⌘I
