[GET] /api/v2/embedded-messages/get-unread-messages-count
This endpoint is used to get the total number of unread messages for a specific customer or visitor. It's an efficient way to display a notification badge or count in your UI without fetching the full message list.
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
tenantId | integer | Yes | Your tenant ID. |
brandId | string | Yes | The ID of the specific brand you are targeting. |
customerId | string | Conditional | The ID for a known, registered customer. One of customerId or visitorId must be provided. |
visitorId | string | Conditional | The ID for an anonymous visitor. One of customerId or visitorId must be provided. |
Request Body
No request body is required for this endpoint.
Example Request (cURL)
Note: The Base URL (https://optimobile-inbox-srv-us.optimove.net
) should be replaced with the correct one for your region.
curl -X GET "[https://optimobile-inbox-srv-us.optimove.net/api/v2/embedded-messages/get-unread-messages-count?tenantId=123&brandId=your_brand_id&customerId=customer456]
Responses
200 OK
- Success
200 OK
- SuccessOn a successful request, the API will return a 200 OK
status with a JSON object containing the total count of unread messages.
Example Success Response:
{
"unread_count": 7
}
Rate Limit
This endpoint is subject to the general API rate limit of 50 requests per 10 seconds. Learn more about handling rate limits.