Fetch notifications
GET {{baseUrl}}/notifications?per_page=<integer>&page=<integer>&read=<boolean>&seen=<boolean>&archived=<boolean>&categories=<string>&categories=<string>&topics=<string>&topics=<string>
Fetch a user's notifications. Notifications are sorted in descendent order by the sent_at timestamp.
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
per_page | string | A limit on the number of notifications to be returned. It can range between 1 and 100, and the default is 15. | |
page | string | A parameter for use in pagination. Defaults to 1. | |
read | string | A filter on the notifications based on the read state. If false, only unread notifications will be returned. Defaults to null. | |
seen | string | A filter on the notifications based on the seen state. If false, only unseen notifications will be returned. Defaults to null. | |
archived | string | A filter on the notifications based on the archived state. If false, only unarchived notifications will be returned. Defaults to null. | |
categories | string | A filter on the notifications based on the category. If you want to get uncategorized notifications, use the "uncategorized" value. | |
The value can be either an array of strings or a comma-separated string. | |||
categories | string | A filter on the notifications based on the category. If you want to get uncategorized notifications, use the "uncategorized" value. | |
The value can be either an array of strings or a comma-separated string. | |||
topics | string | A filter on the notifications based on the topic. | |
topics | string | A filter on the notifications based on the topic. |
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
X-MAGICBELL-API-KEY | string | (Required) The (public) API key of your MagicBell project. | |
X-MAGICBELL-USER-EXTERNAL-ID | string | ID of the user. Provide the X-MAGICBELL-USER-EMAIL header instead if you identify users by email. | |
X-MAGICBELL-USER-EMAIL | string | Email address of the user. Provide the X-MAGICBELL-USER-EXTERNAL-ID header instead if you identify users by ID. | |
X-MAGICBELL-USER-HMAC | string | HMAC calculated with the API secret and ID, or email, of the user. Required if the project has HMAC enabled. | |
Accept | string |
RESPONSES
status: OK
{"project_id":"\u003cinteger\u003e","total":"\u003cinteger\u003e","per_page":"\u003cinteger\u003e","total_pages":"\u003cinteger\u003e","current_page":"\u003cinteger\u003e","unseen_count":"\u003cinteger\u003e","unread_count":"\u003cinteger\u003e","notifications":[{"title":"\u003cstring\u003e","recipient":{"id":"\u003cstring\u003e","external_id":"\u003cstring\u003e","email":"\u003cstring\u003e","first_name":"\u003cstring\u003e","last_name":"\u003cstring\u003e","custom_attributes":{"nostrud_c03":false},"phone_numbers":["\u003cstring\u003e","\u003cstring\u003e"]},"id":"\u003cstring\u003e","content":"\u003cstring\u003e","action_url":"\u003curi\u003e","category":"\u003cstring\u003e","topic":"\u003cstring\u003e","custom_attributes":{"qui9":"velit ex fugiat"},"sent_at":"\u003cnumber\u003e","seen_at":"\u003cnumber\u003e","read_at":"\u003cnumber\u003e","archived_at":"\u003cnumber\u003e"},{"title":"\u003cstring\u003e","recipient":{"id":"\u003cstring\u003e","external_id":"\u003cstring\u003e","email":"\u003cstring\u003e","first_name":"\u003cstring\u003e","last_name":"\u003cstring\u003e","custom_attributes":{"in_0":"des","sintde":false,"quis_bb":86992009},"phone_numbers":["\u003cstring\u003e","\u003cstring\u003e"]},"id":"\u003cstring\u003e","content":"\u003cstring\u003e","action_url":"\u003curi\u003e","category":"\u003cstring\u003e","topic":"\u003cstring\u003e","custom_attributes":{"amet_3e":"labore cillum"},"sent_at":"\u003cnumber\u003e","seen_at":"\u003cnumber\u003e","read_at":"\u003cnumber\u003e","archived_at":"\u003cnumber\u003e"}]}