Unread Message Counts
curl --request GET \
--url https://web-api.clerk.chat/public/messages/unreadCounts \
--header 'apiKey: <api-key>'import requests
url = "https://web-api.clerk.chat/public/messages/unreadCounts"
headers = {"apiKey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apiKey: '<api-key>'}};
fetch('https://web-api.clerk.chat/public/messages/unreadCounts', 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://web-api.clerk.chat/public/messages/unreadCounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apiKey: <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://web-api.clerk.chat/public/messages/unreadCounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apiKey", "<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://web-api.clerk.chat/public/messages/unreadCounts")
.header("apiKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://web-api.clerk.chat/public/messages/unreadCounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apiKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"unreadMessageCounts": {
"<INBOX_ID>": {
"<USER_ID>": 10
}
}
}Messages
Unread Message Counts
Get Unread Messages Counts for Users organized by Inbox
GET
/
public
/
messages
/
unreadCounts
Unread Message Counts
curl --request GET \
--url https://web-api.clerk.chat/public/messages/unreadCounts \
--header 'apiKey: <api-key>'import requests
url = "https://web-api.clerk.chat/public/messages/unreadCounts"
headers = {"apiKey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apiKey: '<api-key>'}};
fetch('https://web-api.clerk.chat/public/messages/unreadCounts', 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://web-api.clerk.chat/public/messages/unreadCounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apiKey: <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://web-api.clerk.chat/public/messages/unreadCounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apiKey", "<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://web-api.clerk.chat/public/messages/unreadCounts")
.header("apiKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://web-api.clerk.chat/public/messages/unreadCounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apiKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"unreadMessageCounts": {
"<INBOX_ID>": {
"<USER_ID>": 10
}
}
}Authorizations
Query Parameters
The IDs of the Inboxes to filter unread message counts by. If not provided, all inboxes will be included. You must include at least one of the documented query parameters: inboxIds or userIds.
The IDs of Users to filter unread message counts by. If not provided, all users will be included. You must include at least one of the documented query parameters: inboxIds or userIds.
Response
Object of Unread Counts organized by Inbox Ids
Show child attributes
Show child attributes
Example:
{ "<INBOX_ID>": { "<USER_ID>": 10 } }