Notifications¶
Manage notifications in your application.
list¶
Retrieves all notifications from the application with optional filtering.
See: Notification
Parameters:
Optional queryObj: NotificationQuery(Query)Query parameters to filter the results.Returns:
from tagoio_sdk import Resources resources = Resources() result = resources.notifications.list({"filter": {"read": False}, "amount": 10}) print(result) # [{'id': 'notification-id-123', 'title': 'System Update', 'message': 'Features', ...}]
markAsRead¶
Marks one or multiple notifications as read.
See: Notification
Parameters:
notificationIDS: Union[str, list[str]]Notification ID or list of notification IDsReturns:
stringfrom tagoio_sdk import Resources resources = Resources() # Mark single notification resources.notifications.markAsRead("notification-id-123") # Mark multiple notifications resources.notifications.markAsRead(["id-1", "id-2"])
markAsUnread¶
Marks one or multiple notifications as unread.
See: Notification
Parameters:
notificationIDS: Union[str, list[str]]Notification ID or list of notification IDsReturns:
stringfrom tagoio_sdk import Resources resources = Resources() # Mark single notification resources.notifications.markAsUnread("notification-id-123") # Mark multiple notifications resources.notifications.markAsUnread(["id-1", "id-2"])
markAllAsRead¶
Marks all notifications in the application as read.
See: Notification
Parameters:
NoneReturns:
stringfrom tagoio_sdk import Resources resources = Resources() result = resources.notifications.markAllAsRead() print(result) # All TagoIO Notification Run Successfully Updated
create¶
Creates a new notification in the system.
See: Notification
Parameters:
notificationData: NotificationCreateNotification data to createReturns:
dictfrom tagoio_sdk import Resources resources = Resources() result = resources.notifications.create({"title": "System Update", "message": "New features available"}) print(result["id"]) # notification-id-123
remove¶
Permanently deletes a notification from the system.
See: Notification
Parameters:
notificationID: strNotification IDReturns:
stringfrom tagoio_sdk import Resources resources = Resources() result = resources.notifications.remove("notification-123") print(result) # Successfully Removed