Oxide Advanced Topics - fullphat/snarl_network_protocol GitHub Wiki

Warning This is provisional documentation. Applications should not attempt to implement any features listed in this document, other than for development or testing purposes. The documentation is provided for open access to encourage interest in forthcoming features and to solicit feedback and suggestions. It is therefore provided "as is" and is subject to ongoing change and revision.

Subscriptions

SNP/HTTP v2 supports the ability to subscribe to notifications from Snarl, or any other server that supports SNP/HTTP v2. The concept of subscribing to notifications is detailed in the (main Snarl Developer Guide) but, in summary, an application can act as a source of notifications and other applications can subscribe to receive notifications from it.

SNP/HTTP v2 supports subscribing using the /subscriptions endpoint. The following functions are defined:

Method Function Description
POST /subscriptions Create a new subscription
GET /subscriptions Lists the current subscriptions associated with the client's access_token
DELETE /subscriptions/{guid} Unsubscribes a particular subscription
DELETE /subscriptions Unsubscribes all subscriptions associated with the client's access_token

Subscribing

When subscribing, you must provide a URL that subsequent notifications will be sent to. This URL should be supplied in the forward-to argument. SNP/HTTP v2 servers will then POST the content of any forwarded notifications to this URL.

Forwarding