Get Notification List
Description
Gets notification list via the web service.
Function Signature:
def get_notification_list(ws_config: WebServiceConfig, last_epoch_time: int, seen_in_app: bool = False, sent_as_email: bool = False) -> NotificationListResult:
Parameters
- ws_config (WebServiceConfig): Configuration for the web service connection.
- last_epoch_time (int): Last epoch timestamp.
- seen_in_app (bool): Filter for notifications seen in app.
- sent_as_email (bool): Filter for notifications sent as email.
Returns
- NotificationListResult: A result object containing:
code: HTTP status code (200 for success,-1for exceptions).description: Response body or error message.notification_list: Parsed response data when available.
Example Usage
# Example usage
ws_config = WebServiceConfig(access_key="key", secret_key="secret", base_url="https://api.example.com/")
last_epoch_time = 1
seen_in_app = False
sent_as_email = False
result = get_notification_list(ws_config, last_epoch_time, seen_in_app, sent_as_email)
print(result)
Behavior
- Sends a signed request to the web service.
- On success (code 200), response data is parsed into the result object.
- On success, returns the computed value or result object.
Error Handling
- Exceptions set the result code to
-1and include an error message when implemented.