API Reference - Website Notifications
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108118
← Back to API Reference | Getting Started
Website Notifications
Website Notifications are the internal activity log that drives the admin notification center. Each record captures an event that occurred on the site (EG a new member joining, a post being saved, a lead being submitted), the record it relates to, and who triggered it. Notifications can be filtered by category, viewed status, and related table to build activity feeds or audit trails.
website_notifications — DB table: website_notificationsThe Website Notification Object
| Field | Type | Description |
|---|---|---|
notification_id | integer | Unique notification ID (primary key, read-only) |
notification_status | integer | Status code for this notification (EG 1 active, 4 archived) required on create |
notification_title | string | Short title or subject line for this notification; max 255 characters required on create |
notification_message | text | Full message body describing the event (EG "user@example.com saved a post") required on create |
notification_category | integer | Top-level category code grouping this notification type |
notification_sub_category | integer | Sub-category code providing more granular classification within the category |
notification_view | integer | Whether this notification has been viewed: 1 viewed, 0 unread |
notification_table | string | Name of the database table containing the record this notification relates to (EG user, users_portfolio_groups); max 255 characters |
notification_table_index | string | Primary key column name of the related table (EG user_id, group_id); max 255 characters |
notification_table_index_value | string | Primary key value of the specific record this notification relates to; max 255 characters |
notification_date | string | Date and time the event occurred, stored as a 12-character string (format YYYYMMDDHHMM); max 255 characters |
notification_token | string | Unique token associated with this notification for deduplication or linking; max 255 characters |
interactor | string | The actor type that triggered this event (EG member, admin, visitor); max 255 characters |
interactor_index | string | The ID of the interacting actor (EG the member's user ID); max 255 characters |
interactor_ip | string | IP address of the interactor at the time of the event; max 255 characters |
List Website Notifications
Example Request
curl -X GET "https://www.yourdomain.com/api/v2/website_notifications/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Example Response
{
"status": "success",
"message": [
{
"notification_id": "1",
"notification_status": "4",
"notification_title": "na",
"notification_message": "member@example.com saved a post - Example Post Title",
"notification_category": "0",
"notification_sub_category": "38",
"notification_view": "0",
"notification_table": "users_portfolio_groups",
"notification_table_index": "group_id",
"notification_table_index_value": "4032",
"notification_date": "202205050704",
"notification_token": "717c047f106e6e20fb6199d8fec51b3b",
"interactor": "member",
"interactor_index": "175",
"interactor_ip": "203.0.113.45"
}
],
"total": "12100",
"current_page": 1,
"total_pages": 484,
"next_page": "MipfKjI1"
}Retrieve a Website Notification
Example Request
curl -X GET "https://www.yourdomain.com/api/v2/website_notifications/get/1" \ -H "X-Api-Key: your-api-key-here"
Example Response
{
"status": "success",
"message": [
{
"notification_id": "1",
"notification_status": "4",
"notification_title": "na",
"notification_message": "member@example.com saved a post - Example Post Title",
"notification_category": "0",
"notification_sub_category": "38",
"notification_view": "0",
"notification_table": "users_portfolio_groups",
"notification_table_index": "group_id",
"notification_table_index_value": "4032",
"notification_date": "202205050704",
"notification_token": "717c047f106e6e20fb6199d8fec51b3b",
"interactor": "member",
"interactor_index": "175",
"interactor_ip": "203.0.113.45"
}
],
"total": "1",
"current_page": 1,
"total_pages": 1
}Create a Website Notification
Example Request
curl -X POST "https://www.yourdomain.com/api/v2/website_notifications/create" \ -H "X-Api-Key: your-api-key-here" \ -d "notification_status=1" \ -d "notification_title=New+Member+Signup" \ -d "notification_message=member@example.com+joined+as+a+new+member." \ -d "notification_category=0" \ -d "notification_sub_category=0" \ -d "notification_view=0" \ -d "notification_table=user" \ -d "notification_table_index=user_id" \ -d "notification_table_index_value=42" \ -d "notification_date=202604030900" \ -d "interactor=member" \ -d "interactor_index=42"
Example Response
{
"status": "success",
"message": {
"notification_id": "12109",
"notification_status": "1",
"notification_title": "New Member Signup",
"notification_message": "member@example.com joined as a new member.",
"notification_category": "0",
"notification_sub_category": "0",
"notification_view": "0",
"notification_table": "user",
"notification_table_index": "user_id",
"notification_table_index_value": "42",
"notification_date": "202604030900",
"notification_token": null,
"interactor": "member",
"interactor_index": "42",
"interactor_ip": null
}
}Update a Website Notification
Example Request
curl -X PUT "https://www.yourdomain.com/api/v2/website_notifications/update" \ -H "X-Api-Key: your-api-key-here" \ -d "notification_id=12109" \ -d "notification_view=1"
Example Response
{
"status": "success",
"message": {
"notification_id": "12109",
"notification_status": "1",
"notification_title": "New Member Signup",
"notification_message": "member@example.com joined as a new member.",
"notification_category": "0",
"notification_sub_category": "0",
"notification_view": "1",
"notification_table": "user",
"notification_table_index": "user_id",
"notification_table_index_value": "42",
"notification_date": "202604030900",
"notification_token": "",
"interactor": "member",
"interactor_index": "42",
"interactor_ip": ""
}
}Delete a Website Notification
Example Request
curl -X DELETE "https://www.yourdomain.com/api/v2/website_notifications/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "notification_id=12109"
Example Response
{
"status": "success",
"message": "website_notifications record was deleted"
}