Consultar contadores de chats
curl --request GET \
--url https://api.wppfy.com/chat/totalcount \
--header 'token: <api-key>'import requests
url = "https://api.wppfy.com/chat/totalcount"
headers = {"token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {token: '<api-key>'}};
fetch('https://api.wppfy.com/chat/totalcount', 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/totalcount",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.wppfy.com/chat/totalcount"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("token", "<api-key>")
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.wppfy.com/chat/totalcount")
.header("token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/chat/totalcount")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"total_chats": {
"total": 123,
"unread": 123
},
"open_chats": {
"total": 123,
"unread": 123
},
"archived_chats": {
"total": 123,
"unread": 123
},
"group_chats": {
"total": 123,
"unread": 123
},
"blocked_chats": {
"total": 123,
"unread": 123
},
"label_counts": [
{
"id": "<string>",
"labelid": "<string>",
"name": "<string>",
"total": 123,
"unread": 123
}
],
"attendant_counts": [
{
"id": "<string>",
"name": "<string>",
"total": 123,
"unread": 123
}
]
}Chats
Consultar contadores de chats
Retorna contadores totais e não lidos por estado, etiqueta e atendente. Os arrays são retornados vazios quando ainda não há etiquetas ou atendentes.
GET
/
chat
/
totalcount
Consultar contadores de chats
curl --request GET \
--url https://api.wppfy.com/chat/totalcount \
--header 'token: <api-key>'import requests
url = "https://api.wppfy.com/chat/totalcount"
headers = {"token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {token: '<api-key>'}};
fetch('https://api.wppfy.com/chat/totalcount', 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/totalcount",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.wppfy.com/chat/totalcount"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("token", "<api-key>")
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.wppfy.com/chat/totalcount")
.header("token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/chat/totalcount")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"total_chats": {
"total": 123,
"unread": 123
},
"open_chats": {
"total": 123,
"unread": 123
},
"archived_chats": {
"total": 123,
"unread": 123
},
"group_chats": {
"total": 123,
"unread": 123
},
"blocked_chats": {
"total": 123,
"unread": 123
},
"label_counts": [
{
"id": "<string>",
"labelid": "<string>",
"name": "<string>",
"total": 123,
"unread": 123
}
],
"attendant_counts": [
{
"id": "<string>",
"name": "<string>",
"total": 123,
"unread": 123
}
]
}Autorizações
Resposta
Contadores atuais dos chats
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
