GET /content/notifications-push

The Content Notifications Push API streams notifications about FT content that has been created, changed or deleted, providing an alternative to polling the standard Notifications API.

The Content Notifications Push API only provides basic information about publish events, to retrieve the content and additional data itself you need to make additional calls to the Content API. You can find more information about using these APIs together here.

To purchase a Content Notifications Push API subscription, please submit a Sales Enquiry and under “Required endpoints” select the “Notifications with Enriched Content with Push” option.

Connecting to Content Notifications Push API

The API is Server-Sent Events (SSE) compliant, and uses a long lived HTTP connection to stream events to the consumer.

However, just as with the other APIs you must authenticate by supplying a valid X-Api-Key header.

Note that you will probably be supplied with a separate API key for use with the Content Notifications Push API than with the rest of the FT APIs.

Resource URL

GET https://api.ft.com/content/notifications-push

Parameters

Do not supply any parameters with this method.

Request Body

Do not supply a request body with this method.

Response

HTTP Statuses

Http StatusDescription
200 OK Real time content notifications in SSE format are being sent to the client

200 OK - Real time content notifications in SSE format are being sent to the client

Conforming to SSE spec, every event is followed by two new line characters (“\n\n”), hence the empty line after each event in the response.

Each event contains an individual, complete JSON document with a new content notification.

For more details about the notification JSON please refer to the notifications resource documentation.

Even though every data line is an array, it will always contain one element.

Below is an example of the response format.

data: [{"apiUrl":"http://api.ft.com/content/9efd12ec-aab1-11e8-8253-48106866cd8a","id":"http://www.ft.com/thing/9efd12ec-aab1-11e8-8253-48106866cd8a","type":"http://www.ft.com/thing/ThingChangeType/UPDATE","title":"Syrians must be given the truth about their missing loved ones","standout":{"scoop":false}}]

data: []

data: [{"apiUrl":"http://api.ft.com/content/bc872538-aab5-11e8-94bd-cba20d67390c","id":"http://www.ft.com/thing/bc872538-aab5-11e8-94bd-cba20d67390c","type":"http://www.ft.com/thing/ThingChangeType/UPDATE","title":"Uganda's Bobi Wine embodies the rise of African youth","standout":{"scoop":false}}]

data: []

data: []

Heartbeats

Even if there would be no events, every 30 seconds an empty-array event will be fired to keep you updated that the app is still working, it also helps firewalls and proxies keep the connection open.

In case these periodic heartbeat events are missing and no new entries come for a period of more than 1 minute, please start over by reconnecting to the API.

This is expected behaviour for the API and might happen every few days.

Server side errors

In case of failures (5xx) please automatically reconnect to the API by using some backoff policy.

Important: requests are rate limited. If the rate exceeds 2-3 requests per second, requests are throttled, resulting in 429 responses.

Recovering missed notifications

In the event where connection to the Notifications Push API is down for any period of time, for whatever reason, you may want to discover what notifications were missed during that period

In this scenario, we recommend using the regular Notifications API to retrieve notifications for the time period where the Push connection was unavailable.

Simply make call to the Notifications API with a since parameter equal to the time of the last notification received through the Push API. If necessary, keep following the next URL in the response until you catch up to notifications you have received from the Push API.

For more details, see the Notifications API documentation.

Clients

Depending on your language there might be several SSE client libraries already available.

For JavaScript you can use eventsource, here is sample code.

If you cannot find any client libraries for your language of choice, it is still easy to implement your own client. Sample go code.