Push Notifications with Pull Requests

Previous:

This page:

The following describes typical use cases for:

Pull Requests

The normal event flow for Pull Requests follows the steps below:

  • FT.com content is published
  • A Pull Request (example shown) is made for all content published since t1, (e.g. where t1 = 2017-01-06T10:00:00.000Z)

Note: If the Pull Request polling interval is too short (request frequency too high) you will receive 429 - Too Many Requests notifications

GET http://api.ft.com/content/notifications?since=2017-01-06T10:00:00.000Z
  • Article ids are returned since t1 (enhanced endpoint shown)
{
  “requestUrl”: “http://api.ft.com/content/notifications?since=2017-01-06T10:00:00.000Z",
  “notifications”: [
    {
      “type”: “http://www.ft.com/thing/ThingChangeType/UPDATE",
      “id”: “http://www.ft.com/thing/7348edd8-0403-11de-845b-000077b07658",
      “apiUrl”: “http://api.ft.com/content/7348edd8-0403-11de-845b-000077b07658"
    }
  ],
  “links”: [
    {
      “href”: “http://api.ft.com/content/notifications?since=2017-01-06T18:42:35.000Z&page=MjAxNy0wMS0wNlQxODo0MjozNVojMCMxMjM0NTY3OA==",
      “rel”: “next”
    }
  ]
}
  • A Pull Request for the apiUrl is made to return the content (redacted example shown), in this case an update of content originally published in 2009

Note: Returned content may also include Article Update Requests and Article Delete Requests, which must be enacted

{
  “id”: “http://www.ft.com/thing/7348edd8-0403-11de-845b-000077b07658",
  “type”: “http://www.ft.com/ontology/content/Article",
  “bodyXML”: “\nGeneral Motors underlined its dire financial condition on Thursday as it reported an unexpectedly heavy cash drain in the final three months of 2008 and warned that Deloitte, its auditor, might cast doubt on its standing as a going concern.\nThe Detroit carmaker, dependent on government aid for survival, reported a fourth-quarter loss of $9.6bn, bringing the 2008 loss to $30.9bn. GM has racked up losses totalling $86.6bn during the past four years.\n\nAdding to its woes, GM disclosed that its pension fund, one of the biggest in the US, has swung over the past year from a $20bn surplus to a $12.4bn deficit.\n\n”,
  “title”: “GM future in doubt after $31bn loss”,
  “byline”: “By Bernard Simon in Toronto and John Reed in Detroit”,
  “firstPublishedDate”: “2009-02-26T13:14:22.000Z”,
  “publishedDate”: “2009-02-26T21:50:28.000Z”,
  “requestUrl”: “http://api.ft.com/content/7348edd8-0403-11de-845b-000077b07658",
  “brands”: [
    “http://api.ft.com/things/dbb0bdae-1f0c-11e4-b0cb-b2227cce2b54"
  ],
  “standout”: {
    “editorsChoice”: false,
    “exclusive”: false,
    “scoop”: false
  },
  “canBeSyndicated”: “verify”,
  “webUrl”: “http://www.ft.com/cms/s/7348edd8-0403-11de-845b-000077b07658.html"
}

Push Notifications with Pull Requests

Note: A Pull Request subscription is a mandatory pre-requisite for Push Notifications. To purchase a Push Notification subscription, please Submit a Sales Enquiry.

For more details about connecting to and using the Push Notifications API, see the API reference page.

The normal event flow for Push Notifications with Pull Requests follows the steps below:

  • A session connection is setup
  • FT.com content is established
  • A Push Notification (example shown) is made
  “data”: [
    {
      “title”: “Investors face challenge of their convictions”,
      “apiUrl”: “http://api.ft.com/content/7348edd8-0403-11de-845b-000077b07658",
      “id”: “http://www.ft.com/thing/7348edd8-0403-11de-845b-000077b07658",
      “type”: “http://www.ft.com/thing/ThingChangeType/UPDATE"
      “standout”: {“scoop”: true}
    }
  ]
  • A Pull Request for the apiUrl is made to return the content (redacted example shown), in this case an update of content originally published in 2009

Note: Returned content may also include Article Update Requests and Article Delete Requests, which must be enacted

{
  “id”: “http://www.ft.com/thing/7348edd8-0403-11de-845b-000077b07658",
  “type”: “http://www.ft.com/ontology/content/Article",
  “bodyXML”: “\nGeneral Motors underlined its dire financial condition on Thursday as it reported an unexpectedly heavy cash drain in the final three months of 2008 and warned that Deloitte, its auditor, might cast doubt on its standing as a going concern.\nThe Detroit carmaker, dependent on government aid for survival, reported a fourth-quarter loss of $9.6bn, bringing the 2008 loss to $30.9bn. GM has racked up losses totalling $86.6bn during the past four years.\n\nAdding to its woes, GM disclosed that its pension fund, one of the biggest in the US, has swung over the past year from a $20bn surplus to a $12.4bn deficit.\n\n”,
  “title”: “GM future in doubt after $31bn loss”,
  “byline”: “By Bernard Simon in Toronto and John Reed in Detroit”,
  “firstPublishedDate”: “2009-02-26T13:14:22.000Z”,
  “publishedDate”: “2009-02-26T21:50:28.000Z”,
  “requestUrl”: “http://api.ft.com/content/7348edd8-0403-11de-845b-000077b07658",
  “brands”: [
    “http://api.ft.com/things/dbb0bdae-1f0c-11e4-b0cb-b2227cce2b54"
  ],
  “standout”: {
    “editorsChoice”: false,
    “exclusive”: false,
    “scoop”: false
  },
  “canBeSyndicated”: “verify”,
  “webUrl”: “http://www.ft.com/cms/s/7348edd8-0403-11de-845b-000077b07658.html"
}

An exception event flow for Push Notifications with Pull Requests follows the steps below:

Note: For example the steps required to capture missed news in the event of a connection failure

  • A session connection is dropped
  • FT.com content is published
  • A session re-connection is established
  • A Pull Request (example shown) is made for all content published since t1, (where t1 = time of connection drop) 
GET http://api.ft.com/content/notifications?since=2017-01-06T10:00:00.000Z
  • Article ids are returned since t1 (example shown)
{
  “requestUrl”: “http://api.ft.com/content/notifications?since=2017-01-06T10:00:00.000Z",
  “notifications”: [
    {
      “type”: “http://www.ft.com/thing/ThingChangeType/UPDATE",
      “id”: “http://www.ft.com/thing/7348edd8-0403-11de-845b-000077b07658",
      “apiUrl”: “http://api.ft.com/content/7348edd8-0403-11de-845b-000077b07658"
    }
  ],
  “links”: [
    {
      “href”: “http://api.ft.com/content/notifications?since=2017-01-06T18:42:35.000Z&page=MjAxNy0wMS0wNlQxODo0MjozNVojMCMxMjM0NTY3OA==",
      “rel”: “next”
    }
  ]
}
  • A Pull Request for the apiUrl is made to return the content (redacted example shown), in this case an update of content originally published in 2009

Note: Returned content may also include Article Update Requests and Article Delete Requests, which must be enacted

{
  “id”: “http://www.ft.com/thing/7348edd8-0403-11de-845b-000077b07658",
  “type”: “http://www.ft.com/ontology/content/Article",
  “bodyXML”: “\nGeneral Motors underlined its dire financial condition on Thursday as it reported an unexpectedly heavy cash drain in the final three months of 2008 and warned that Deloitte, its auditor, might cast doubt on its standing as a going concern.\nThe Detroit carmaker, dependent on government aid for survival, reported a fourth-quarter loss of $9.6bn, bringing the 2008 loss to $30.9bn. GM has racked up losses totalling $86.6bn during the past four years.\n\nAdding to its woes, GM disclosed that its pension fund, one of the biggest in the US, has swung over the past year from a $20bn surplus to a $12.4bn deficit.\n\n”,
  “title”: “GM future in doubt after $31bn loss”,
  “byline”: “By Bernard Simon in Toronto and John Reed in Detroit”,
  “firstPublishedDate”: “2009-02-26T13:14:22.000Z”,
  “publishedDate”: “2009-02-26T21:50:28.000Z”,
  “requestUrl”: “http://api.ft.com/content/7348edd8-0403-11de-845b-000077b07658",
  “brands”: [
    “http://api.ft.com/things/dbb0bdae-1f0c-11e4-b0cb-b2227cce2b54"
  ],
  “standout”: {
    “editorsChoice”: false,
    “exclusive”: false,
    “scoop”: false
  },
  “canBeSyndicated”: “verify”,
  “webUrl”: “http://www.ft.com/cms/s/7348edd8-0403-11de-845b-000077b07658.html"
}

Note: To purchase a Headline Licence or Datamining Licence please Submit a Sales Enquiry

Next: