cURL
curl https://api.bodhveda.com/recipients/recipient_123/notifications/unread-count \
-H "Authorization: Bearer bv_xxxxxxxxx"import { Bodhveda } from "@bodhveda/js";
const bodhveda = new Bodhveda("bv_xxxxxxxxx");
const res = await bodhveda.recipients.notifications.unreadCount("recipient_123");
// res.unread_countimport (
"context"
bodhveda "github.com/MudgalLabs/bodhveda/sdk/go"
)
ctx := context.Background()
client := bodhveda.NewClient("bv_xxxxxxxxx", nil)
res, _ := client.Recipients.Notifications.UnreadCount(ctx, "recipient_123")
// res.UnreadCountimport { useNotificationsUnreadCount } from "@bodhveda/react";
// Requires a <BodhvedaProvider recipientID="recipient_123"> higher in the tree.
function Badge() {
const { data } = useNotificationsUnreadCount();
return <span>{data?.unread_count ?? 0}</span>;
}{
"data": {
"unread_count": 5
}
}{
"message": "Recipient not found"
}Notifications
Unread count
Returns the number of unread notifications for a recipient.
This is the recipient-facing feed, so it excludes notifications the recipient was never shown: muted (their preferences disallowed it), quota_exceeded, and not_requested (an email-only send, which created no in-app notification). To see those, use the Console — they are exactly the rows you need when asking “why didn’t they get it?”.
GET
/
recipients
/
{recipient_id}
/
notifications
/
unread-count
cURL
curl https://api.bodhveda.com/recipients/recipient_123/notifications/unread-count \
-H "Authorization: Bearer bv_xxxxxxxxx"import { Bodhveda } from "@bodhveda/js";
const bodhveda = new Bodhveda("bv_xxxxxxxxx");
const res = await bodhveda.recipients.notifications.unreadCount("recipient_123");
// res.unread_countimport (
"context"
bodhveda "github.com/MudgalLabs/bodhveda/sdk/go"
)
ctx := context.Background()
client := bodhveda.NewClient("bv_xxxxxxxxx", nil)
res, _ := client.Recipients.Notifications.UnreadCount(ctx, "recipient_123")
// res.UnreadCountimport { useNotificationsUnreadCount } from "@bodhveda/react";
// Requires a <BodhvedaProvider recipientID="recipient_123"> higher in the tree.
function Badge() {
const { data } = useNotificationsUnreadCount();
return <span>{data?.unread_count ?? 0}</span>;
}{
"data": {
"unread_count": 5
}
}{
"message": "Recipient not found"
}Authorizations
Bearer authentication header of the form Bearer bv_xxxxxxxxx, where bv_xxxxxxxxx is your API Key with Full access or Recipient acess scope.
Path Parameters
The unique identifier of the recipient.
Response
Unread notification count for the recipient.