Subscription

Overview

The following is an overview for using the WebSub protocol to setup a subscription. It works by sending a POST request to our WebSub hub url (https://hub.mfn.se) with some parameters as Form data. Available parameters are listed below in the API reference.

Required parameters

  • hub.mode Should be set to subscribe to setup a new subscription.

  • hub.callback Endpoint URL that you would like to setup a subscription for.

    • for example https://site.se/news/mfn-sink/j40sk6kfj43lgkr

  • hub.topic the topic to subscribe to

    • For all news in json format the topic is /s.json

    • For all news in xml format the topic is /s.xml

Additional parameters

  • hub.secret Recommended. A secret provided by you that we will use to HMAC sign the HTTP body of any POST requests sent to your endpoint.

Flow

  1. Client POSTs to our APIs WebSub Hub URL with the required params described above

  2. Our API (the Hub) sends a GET request to the endpoint URL provided (hub.callback)

    • The request contains a challenge random string as a query param (hub.challenge)

  3. The endpoint should then echo back the challenge back in the HTTP Body. This verifies the intent of the subscription

  4. The original POST request (1) returns with 202 Accepted

Last updated