# Webhook confirm subscription

This endpoint confirms a webhook subscription.

CONFIRMATION_URL

You can make a request to this endpoint by using a "confirmation_url". You can find this URL in the confirmation message. The confirmation message is returned in the response to a request to the webhook_subscribe endpoint. The confirmation message is returned to the provided "callback_url".

Method Path Operation*
GET /notifications/webhooks/{account}?token={token} webhook_confirm_subscription

*

This endpoint does not require User Secret (API key) authorization.

# Request

Parameter Type In Description
token
required
string query string Unique subscription token generated by the system.
account
required
string path Account UUID.

# Response

Attribute Type Description
subscription dictionary
Subscription details.
Attribute Type Description
topic string Name of the subscription topic. It must match the regular expression(opens new window) ^[0-9A-Za-z\-]{3,48}$.
account string Account UUID.
validity_ts timestamp Time at which the subscription expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
unsubscribe_url string URL to unsubscribe from a subscription.
refresh_url string URL to refresh a subscription.

# Notification message

Once a subscription is confirmed, in case a notification message is triggered by an event, it will be delivered to the "callback_url" specified when subscribing to a webhook (webhook_subscribe).

The notification messages contain different fields depending on the event that triggered the notification message:

  • notification triggered by the addition of an Entry (Entry added)
  • notification triggered by a change of a Ledger Entry value (Entry value changed)
  • notification triggered by putting a given Sticker on a Twin (Sticker put)
  • notification triggered by removing a given Sticker from a Twin (Sticker removed)
  • notification triggered by a given Sticker expiring (Sticker expired)

# Entry added

Attribute Type Description
type string Message type. For notification messages value should be "Notification".
trigger string Trigger of the notification event. If the notification event is trigger by the addition of an Entry, the value should be "ledger. entry.added".
message string Message UUID.
twin string Twin UUID.
event dictionary
List of Entries where an Entry update triggered the notification with details of the Entry update in form of key-value pairs.
Key Value
new_value Value of the Entry after the update.
old_value Value of the Entry before the update. As the Entry was just created, the value is null.
changed_ts Time at which the value of the Entry was changed. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
sent_ts timestamp Time at which the message was sent. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
subscription dictionary
Subscription details.
Attribute Type Description
topic string Name of the subscription topic. It must match the regular expression(opens new window) ^[0-9A-Za-z\-]{3,48}$.
account string Account UUID.
validity_ts timestamp Time at which the subscription expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
hash string Message hash. Please see the Hash verification section for more details.

# Entry value changed

Attribute Type Description
type string Message type. For notification messages value should be "Notification".
trigger string Trigger of the notification event. If the notification event is trigger by a change to a value of an Entry, the value should be "ledger. entry.updated".
message string Message UUID.
twin string Twin UUID.
event dictionary
List of Entries where an Entry update triggered the notification with details of the Entry update in form of key-value pairs.
Key Value
new_value Value of the Entry after the update.
old_value Value of the Entry before the update.
changed_ts Time at which the value of the Entry was changed. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
sent_ts timestamp Time at which the message was sent. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
subscription dictionary
Subscription details.
Attribute Type Description
topic string Name of the subscription topic. It must match the regular expression(opens new window) ^[0-9A-Za-z\-]{3,48}$.
account string Account UUID.
validity_ts timestamp Time at which the subscription expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
hash string Message hash. Please see the Hash verification section for more details.

# Sticker put

Attribute Type Description
trigger string Trigger of the notification event. If the notification event is defined as the put_sticker operation ("publish": ["on_put"], the value should be "sticker.put".
type string Message type. For notification messages value should be "Notification".
message string Message UUID.
twin string Twin UUID.
event dictionary
Details of the event that triggered the notification message.
Attribute Type Description
color string User-defined category of the Sticker.
message string Message for the recipients of the Sticker.
validity_ts timestamp Time at which the Sticker expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
created_ts timestamp Time at which the Sticker was created. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
put_by list of strings Account UUID, role UUID and user UUID of the user who put the Sticker on the Twin.
sent_ts timestamp Time at which the message was sent. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
subscription dictionary
Subscription details.
Attribute Type Description
topic string Name of the subscription topic. It must match the regular expression(opens new window) ^[0-9A-Za-z\-]{3,48}$.
account string Account UUID.
validity_ts timestamp Time at which the subscription expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
hash string Message hash. Please see the Hash verification section for more details.

# Sticker removed

Attribute Type Description
type string Message type. For notification messages value should be "Notification".
trigger string Trigger of the notification event. If the notification event is defined as the remove_sticker operation ("publish": ["on_remove"], the value should be "sticker.remove".
message string Message UUID.
twin string Twin UUID.
event dictionary
Details of the event that triggered the notification message.
Attribute Type Description
color string User-defined category of the Sticker.
message string Message for the recipients of the Sticker.
validity_ts timestamp Time at which the Sticker expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
created_ts timestamp Time at which the Sticker was created. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
put_by list of strings User UUID of the user who removed the Sticker from the Twin.
sent_ts timestamp Time at which the message was sent. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
subscription dictionary
Subscription details.
Attribute Type Description
topic string Name of the subscription topic. It must match the regular expression(opens new window) ^[0-9A-Za-z\-]{3,48}$.
account string Account UUID.
validity_ts timestamp Time at which the subscription expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
hash string Message hash. Please see the Hash verification section for more details.

# Sticker expired

Attribute Type Description
type string Message type. For notification messages value should be "Notification".
trigger string Trigger of the notification event. If the notification event is to be triggered when the "validity_ts" of a Sticker is reached and the Sticker expires ("publish": ["on_expire"]), the value should be "sticker.expire". A notification message is triggered up to 60 second from the time a Sticker has expired.
message string Message UUID.
twin string Twin UUID.
event dictionary
Details of the event that triggered the notification message.
Attribute Type Description
color string User-defined category of the Sticker.
message string Message for the recipients of the Sticker.
validity_ts timestamp Time at which the Sticker expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
created_ts timestamp Time at which the Sticker was created. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
sent_ts timestamp Time at which the message was sent. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
subscription dictionary
Subscription details.
Attribute Type Description
topic string Name of the subscription topic. It must match the regular expression(opens new window) ^[0-9A-Za-z\-]{3,48}$ In case of Sticker Notifications, the "topic" is always equal to the "color" of the given Sticker..
account string Account UUID.
validity_ts timestamp Time at which the subscription expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch(opens new window).
hash string Message hash. Please see the Hash verification section for more details.

# Status codes

Requests to this endpoint result in generic status codes. For a comprehensive list of status codes, please consult the Status codes section.

Was this article helpful?