Get chat counters
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
Get chat counters
Returns total and unread counters by state, label, and agent. The arrays are returned empty when there are no labels or agents yet.
GET
/
chat
/
totalcount
Get chat counters
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
}
]
}Authorizations
Response
Current chat counters
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
