Skip to content

Notification

Get all notifications attached to your account.

GET /notification

Parameters:

Name Type Description Default
reference_id str

Filter by the reference ID to the third-party system.

None

Returns:

Type Description
list[dict]

list[dict]: List of notification objects containing: - notificationId (str) - referenceId (str) - pushId (str) - secret (str) - os (int) - language (str) - status (int) - lastActiveDate (str) - settings (list[dict])

Source code in nukiwebapi/notification.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
def list_notifications(self, reference_id: str | None = None) -> list[dict]:
    """Get all notifications attached to your account.

    GET /notification

    Args:
        reference_id (str, optional): Filter by the reference ID to the third-party system.

    Returns:
        list[dict]: List of notification objects containing:
            - notificationId (str)
            - referenceId (str)
            - pushId (str)
            - secret (str)
            - os (int)
            - language (str)
            - status (int)
            - lastActiveDate (str)
            - settings (list[dict])
    """
    params = {"referenceId": reference_id} if reference_id else None
    return self.client._request("GET", "/notification", params=params)

Create a notification configuration.

PUT /notification

Parameters:

Name Type Description Default
notification_data dict

Notification representation.

required

Returns:

Name Type Description
dict dict

Created notification object.

Source code in nukiwebapi/notification.py
31
32
33
34
35
36
37
38
39
40
41
42
def create_notification(self, notification_data: dict) -> dict:
    """Create a notification configuration.

    PUT /notification

    Args:
        notification_data (dict): Notification representation.

    Returns:
        dict: Created notification object.
    """
    return self.client._request("PUT", "/notification", json=notification_data)

Get a specific notification configuration.

GET /notification/{notificationId}

Parameters:

Name Type Description Default
notification_id str

The unique notification ID.

required

Returns:

Name Type Description
dict dict

Notification object.

Source code in nukiwebapi/notification.py
44
45
46
47
48
49
50
51
52
53
54
55
def get_notification(self, notification_id: str) -> dict:
    """Get a specific notification configuration.

    GET /notification/{notificationId}

    Args:
        notification_id (str): The unique notification ID.

    Returns:
        dict: Notification object.
    """
    return self.client._request("GET", f"/notification/{notification_id}")

Update a notification configuration.

POST /notification/{notificationId}

Parameters:

Name Type Description Default
notification_id str

The unique notification ID.

required
notification_data dict

Updated notification representation.

required

Returns:

Name Type Description
dict dict

Updated notification object.

Source code in nukiwebapi/notification.py
57
58
59
60
61
62
63
64
65
66
67
68
69
def update_notification(self, notification_id: str, notification_data: dict) -> dict:
    """Update a notification configuration.

    POST /notification/{notificationId}

    Args:
        notification_id (str): The unique notification ID.
        notification_data (dict): Updated notification representation.

    Returns:
        dict: Updated notification object.
    """
    return self.client._request("POST", f"/notification/{notification_id}", json=notification_data)

Delete a notification configuration.

DELETE /notification/{notificationId}

Parameters:

Name Type Description Default
notification_id str

The unique notification ID.

required

Returns:

Type Description
None

None

Source code in nukiwebapi/notification.py
71
72
73
74
75
76
77
78
79
80
81
82
def delete_notification(self, notification_id: str) -> None:
    """Delete a notification configuration.

    DELETE /notification/{notificationId}

    Args:
        notification_id (str): The unique notification ID.

    Returns:
        None
    """
    return self.client._request("DELETE", f"/notification/{notification_id}")