MFN Integration Guide
  • What is MFN
  • Overview
    • Getting started
    • Integration methods
    • Disclaimer / IPO
    • Caching
    • Checklist after integration
  • Integration methods
    • On-Demand API
    • Synced API
    • MFN Loader
    • IFrame Widget
  • Wordpress Plugin
  • MFN Widgets
    • Report archive
    • Email Subscription Widget
    • Media collection
  • API
    • Feed
    • Model
      • Tags
    • Demo Data
    • WebSub
      • Endpoint
      • Subscribe (optional)
      • Ping Extension (optional)
      • Code samples
      • Misc
    • Archive
    • Email Subscription Guide
Powered by GitBook
On this page
  • Overview
  • Required parameters
  • Additional parameters
  • Flow
  • WebSub Subscribe

Was this helpful?

  1. API
  2. WebSub

Subscribe (optional)

WebSub subscribe flow

PreviousEndpointNextPing Extension (optional)

Last updated 2 years ago

Was this helpful?

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 () with some parameters as Form data. Available parameters are listed below in the .

Required parameters

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

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

    • for example https://site.se/investors/news/j40sk6kfj43lgkr

  • hub.topic the topic to subscribe to, in our system this is part of the feed URL

    • for example for the feed URLhttps://feed.mfn.se/v1/feed/2c07a2db-2f22-4a67-ab46-ccb464296638?lang=sv

    • the topic is /feed/2c07a2db-2f22-4a67-ab46-ccb464296638?lang=sv

    • you can read more about how to construct a feed URL in the

Additional parameters

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

  • hub.ext.ping Enables . NOTE: if you enable this, make sure that the your endpoint really supports it.

  • hub.ext.event Enables Extended events (PUT/DELETE methods).

Flow

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

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

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

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

WebSub Subscribe

POST https://feed.mfn.se/v1

Note: all the parameters need to be FORM encoded (x-www-form-urlencoded).

Request Body

Name
Type
Description

hub.mode

string

subscribe | unsubscribe

hub.topic

string

Topic to subscribe to. Suffix of feed URL after /v1/

hub.callback

string

Endpoint to setup a posthook for

hub.secret

string

WebSub secret for HMAC signing and verification

hub.ext.ping

boolean

Enable Ping extension. NOTE: if you enable this, make sure that the your endpoint really supports it.

hub.ext.event

boolean

Enable Extended events (PUT/DELETE methods)

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

endpoint
https://feed.mfn.se/v1
Endpoint
feed documentation
Ping Extension
API reference