User logs
Logs contain the holistic data on notifications and notification messages a target user receives. As for notifications, a Notification overview resource and Notification details resource contain information on how many notification messages have been sent out, when the notification arrived at the target user's channel, and how many users have clicked the message. Meanwhile, you can also retrieve all the Notification messages that a single target user has received from a specified time point.
These figures also can be monitors in the Logs page on Sendbird Dashboard.
Resource representation
Depending on the call, a response may contain different resources as follows.
Notification message
A Notification message is an actual message that an end user receives as a result of a notification you've sent. Thus, the Notification message resource contains more data on the message and message event that each target user received. This is returned when requesting user logs.
Name | Type | Description |
---|---|---|
notification_id | string | The unique ID of the notification. |
template_key | string | The template key of the notification. |
channel | nested object | The channel of the notification. |
channel.key | string | The key of the channel. |
channel.type | string | The type of the channel. |
mode | string | The delivery mode of the notification. Options: real-time, batch. |
title | string | The title of the notification. If not specified, the value is null. |
tag | string | The tag of the notification. If not specified, the value is null. |
priority | string | The priority of the batch notification. Options: high, normal, low. |
message_data | nested object | The data for the notification. |
message_data.message_status | string | The status of the notification message. Valid values are |
message_data.channel_url | string | The unique URL of the channel where the message is sent to. |
message_data.label | string | The label of the notification. |
message_data.template_variables | nested object | The template variables used to send the notification. |
message_data.event_logs | nested object | The event logs for the notification message. |
message_data.event_logs.sent_at | long | Timestamp in milliseconds when the notification message was sent. |
message_data.event_logs.impression_at | long | Timestamp in milliseconds when the notification message was marked as impression. (Default: |
message_data.event_logs.clicked_at | long | Timestamp in milliseconds when the notification message was marked as clicked. (Default: |
message_data.custom_event_logs | nested object | The custom event logs for the notification message. |
message_data.custom_event_logs.{topic} | long | Timestamp in milliseconds when the notification message was marked by custom event topic. |
List notification messages a user received
This API retrieves all the logs on notification messages that a user has received since the specified message_ts
.
HTTP Request
Request body
Required | Type | Description |
---|---|---|
user_id | string | Specifies the user ID to retrieve notification messages. |
channel_key | string | Specifies the channel key to retrieve notification messages. |
message_ts | long | Specifies the timestamp to be the reference point of the query in Unix milliseconds. |
include_event_logs | bool | Specifies whether to include event logs in the response or not. |
Optional | Type | Description |
---|---|---|
prev_limit | string | Specifies the number of previously sent messages to retrieve before. For example, if |
next_limit | long | Specifies the number of sent messages to retrieve after |
reverse | boolean | Determines whether to sort the results in reverse chronological order. If set to |
include_only_removed | boolean | Determines whether to include only messages removed from the channel in the results. (Default: |
Response
If successful, this action returns a list of Notification message resources in the response body.