Conversations
Count unread messages
Returns the total of unreadCount across all your conversations. Use it for an inbox badge, then call GET /conversations to see which threads are unread.
GET
/
conversations
/
unread-count
cURL
curl --request GET \
--url https://api.vobiz.ai/api/v1/sms/conversations/unread-count \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.conversations.unread_count()
const options = {
method: 'GET',
headers: {'X-Auth-ID': '<api-key>', 'X-Auth-Token': '<api-key>'}
};
fetch('https://api.vobiz.ai/api/v1/sms/conversations/unread-count', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"totalUnread": 4
}{
"error": "missing or invalid credentials"
}{
"error": "internal error"
}Authorizations
Your Vobiz account Auth ID (MA_XXXXXXXX).
Your Vobiz account Auth Token.
Response
The unread total.
The unread total across all your conversations.
Sum of unreadCount over all your conversations. 0 when every thread has been marked read.
Example:
4
Was this page helpful?
⌘I
cURL
curl --request GET \
--url https://api.vobiz.ai/api/v1/sms/conversations/unread-count \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.conversations.unread_count()
const options = {
method: 'GET',
headers: {'X-Auth-ID': '<api-key>', 'X-Auth-Token': '<api-key>'}
};
fetch('https://api.vobiz.ai/api/v1/sms/conversations/unread-count', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"totalUnread": 4
}{
"error": "missing or invalid credentials"
}{
"error": "internal error"
}