TT Nyhetsbyrån offers several APIs for integration purposes.
|Media API||OAuth2, API key||Access to metadata and digital assets. Trigger deliveries.||Active|
|Content API||OAuth2, API key||Search, real time push, creating notifications.||Active|
|Deliveries||Automatic delivery of content||Active|
|Search API||API key||Search||Deprecated|
|Push API||API key||Real time push||Deprecated|
HTTP downloads, Trigger deliveries
The media API is for downloading content such as metadata, images, articles and also zips with bundled metadata and articles. Such bundles are defined using delivery channels.
A channel specifies both formats and method of delivery. Such deliveries can be either download or any push delivery such as FTP. Hence the media API both for downloading and on-demand triggering deliveries.
Content search, long poll, notifications
The Content API replaces the old Search and Push APIs. It allows clients to query our database for content, and listen for real time updates (using long poll). The search API is largely compatible with the old Search API to make migration easy.
The Content API also has some support for creating automatic mobile and email notifications.
Albeit deliveries may be pushing the definition of "API", the reality is that several integrations use the Media API to on-demand trigger a delivery, or simply have a continuous delivery of article metadata.
We use delivery channels to configure both formats and method of delivery.
Configure deliveries using kundwebb
To query our database for keywords and metadata, the search API provides a request-response HTTP method.
This API is not suitable for polling integrations. I.e. where the same query is repeatedly run to discover new material. Use the streaming endpoint of the Content API instead.
Socket.IO, Long poll
The push API is for supporting more "modern" push methods than traditional upload protocols (like FTP). Significant for these methods is a need to support somewhat non-dependable transports where a list of latest x number of articles can be presented.
The Media API and the Content API support OAuth2 token bearer authentication.
All our APIs also support API Key authentication, which requires a secret
key that ties the request to a user to be sent along with each request.
Note that the way keys are sent differ between APIs; the Content API
requires the key to be sent in the
Authorization header, while the others
accept the key as the query parameter
Users can manage their application keys on the Mina Sidor -> API-nycklar page.