Synced API

Description

By "Synced API" we mean that you can have all news items of the company synced / mirrored locally in your own backend / database. Unlike when fetching the data on-demand, you instead fetch and upsert the news items to your database.

You can achieve this by setting up a WebSub posthook, which will do a POST to your web server whenever there's a new news item. The body of the posthook will include the news item in JSON or XML format, but you can also choose to treat the posthook as an indication there's a new news item, and then use that as a trigger to sync/pull/refresh from our API feed endpoint.

Method 1: Using the provided news item from the posthook

The POST request content will contain the news item in JSON or XML format.

IMPORTANT If you're using the news item in the POSTs body, it is very important that you verify the HMAC signature to make sure that a bad actor cant insert news items into your site, if they find out the post hook URL.

Method 2: Using the posthook as a refresh trigger

Optionally the posthook can just be used as a trigger for when an update to the feed is available. And thus trigger a sync/refresh job on your end. This job should then upsert news-items based on news_id in your system to avoid duplicates.

Integrating the news feed

As with this method consume the data from MFN.se and store it locally, you need to handle the logic for filtering etc. yourself. Our news Model describes the available tags to filter on.

Last updated