Get Unread Messages Count

[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

ParameterTypeRequiredDescription
tenantIdintegerYesYour tenant ID.
brandIdstringYesThe ID of the specific brand you are targeting.
customerIdstringConditionalThe ID for a known, registered customer. One of customerId or visitorId must be provided.
visitorIdstringConditionalThe 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

On 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.