notifications_get
Retrieve a specific web push notification and its statistics by providing its ID. Only notifications created in the last 35 days are accessible.
Instructions
To get a notification and its stats,
send a GET request to /notifications/NOTIFICATION_ID.
Only the notifications created in the last 35 days are available.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notification_id | Yes | The ID of a notification. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | A unique identifier for each notification. This is automatically generated upon notification creation. | |
| ttl | No | The number of seconds after which the notification should be dropped if the device of the user is offline. | |
| body | No | The main text of the push notification. | |
| tags | No | The segments that should receive this push notification (i.e. the browsers that have at least one of these tags associated will receive the notification). If both uids and tags are present, only the browsers that match both the conditions will receive the notification (i.e. a browser must be associated to a user ID listed in uids and have at least one of those tags). Instead of simple tags, you can pass boolean expressions that use the operators !, &&, || (from highest to lowest precedence) and can include parentheses. If you pass an array of tags and boolean expressions they are interpreted as ||: the example above is equivalent to "tag0 || tag1 || tagA && !tagB". When the field is omitted or null, it is ignored and the push notification is sent to everyone or to the people specified by uids. When the field is an empty array, the notification will not be sent to anyone. | |
| uids | No | The users that should receive this push notification. When the field is omitted or null, it is ignored and the push notification is sent to everyone or to the people specified by tags. When the field is an empty array, the notification will not be sent to anyone. | |
| title | No | The title of the push notification. | |
| silent | No | Set to true if you want to disable the notification sound and vibration. | |
| urgent | No | Set to true for time-sensitive alerts (e.g. incoming phone call) that must wake up devices that are sleeping. | |
| actions | No | Add some action buttons to the notification. | |
| send_at | No | A time when the notification will be sent. | |
| starred | No | Bookmark the notification to make it easier to find it from the Pushpad dashboard. You can use this feature to highlight some notifications, for example those that have been sent manually. | |
| icon_url | No | The url of an image that will be used as the notification icon. Suggested size: 192x192px. | |
| badge_url | No | The url of a small image (that represents the app or the notification category) that will be displayed when there is not enough space to display the full notification (e.g. Android status bar). Suggested size: 96x96px. | |
| cancelled | No | The notification has been cancelled. A notification can be cancelled on purpose or it can be cancelled by the system (for example if you exceed the usage quota). | |
| image_url | No | The url of an image that will be displayed in the notification content. Suggested size: 800px for the longer side. | |
| scheduled | No | The deliveries have not started yet. You can try to cancel a notification that is in this status. | |
| created_at | No | A time value given in ISO 8601 format. It represents when the notification was created. | |
| project_id | No | The ID of the project the notification belongs to. | |
| target_url | No | The url the user is redirected to when clicks the push notification. | |
| custom_data | No | An arbitrary string that represents some metadata that you want to attach to the notification. This string is passed as an argument to the JavaScript functions binded to the action buttons. | |
| opened_count | No | The number of notifications that were clicked or opened. | |
| custom_metrics | No | Aggregate the stats for this notification into the specified buckets (you can add up to 3 buckets for a single notification). Custom metrics are a way to aggregate the stats for all the notifications that belong to a given category. You need to explicitly create the categories from the project settings before using this feature. You can learn more in the Monitoring section of the documentation. | |
| scheduled_count | No | The number of deliveries that are still in the sending queue. | |
| require_interaction | No | Set to true in order to prevent browser from automatically closing the notification after a few seconds. Currently this applies only to Chrome on desktop. | |
| successfully_sent_count | No | The number of notifications that were sent successfully by Pushpad. |