Getting Started with the Newscoop RESTful API

This tutorial shows you how to authenticate a client web application with Newscoop, and how to extract a list of articles for a particular topic. It assumes you have a working Newscoop installation, you know the URI of your client web application and you have a valid Newcoop user account.

Pre Authentication Setup

Before your client web application can use the Newscoop RESTful API, you need to add it to the “Client List” in the Newscoop Admin interface . You need to provide

  • A name for your client web application.
  • The Newcoop Publication you are accessing.
  • The URI of your client web application which parses the authentication token sent by Newscoop.

In this article, we use the following example URLS:

  • your application.
  • your Newscoop server installation.

After adding the client application, make a note of the “Client id” displayed in the table, you need it to authenticate.

Authentication for web applications

To authenticate your client web application:

  1. Make a GET request to /oauth/v2/auth using the following parameters:


    Your client id, for example 9_1irxa0qcy3ms48c8c8wsgcgsc04k0s0w0g0sg4cco4kocoowoo


    The URI of your client web application, for example This must match the URI you added in the Newscoop Admin Interface above. Remember to encode the URI.



    A full request looks like this:
  2. Log in to the Newscoop window you are redirected to, and click the “Allow Access” button to authenticate your client web application for one hour. You are redirected to the URI you specified in the request, with the following extra parameters:


    The authentication token to use in your client application requests.



    Number of seconds before the authentication token expires. After that you need to request a new one, or refresh the old one. Example 2592000.


    Token type according to the OAUTH 2.0 Authorization Framework. Must be the string bearer.


    Extend the validity of your authentication token for another hour by refreshing.


    A full response looks like this:

    If there is an error in authentication, or the URI does not match the URI configured in the Newscoop Admin Interface, the response includes an error code instead:
  3. Make sure any further requests, including the ones in the Getting a list of Articles section, include the access_token parameter returned in the previous step.

Getting a list of Articles

To get a list of Articles for a particular topic you need to make two requests, one to list the topics, and another to get the articles for a particular topic:

  1. Make a GET request to /rest-api/topics using the authentication token from Authentication for web applications.

    The request looks like this:

    The response looks like this:

      "items" :  [
          "id" :  395 ,
          "title" :  "Caspar Baader"
          "id" :  394 ,
          "title" :  "Thomas de Courten"
          "id" :  268 ,
          "title" :  "Völkermord"
      "pagination" :  {
        "itemsPerPage" :  10 ,
        "currentPage" :  1 ,
        "itemsCount" :  771 ,
        "nextPageLink" :  ""

    Note the pagination link at the bottom of the json items array, containg the parameters page and items_per_page. The nextPageLink is generated for each request, or you can add the parameters yourself to a request.

  2. To get a list of topics about Thomas de Courten, for example, make a note of the relevant id and make a GET request to /rest-api/topics/{id}/{language}/articles, replacing {id} with 394 and {language} with de.


    Currently you need to know the language code of the topic to make the request. You can see what language a topic is written in in the Newscoop Admin Interface.

    The response contains the topic id and title, and a list of items:

      "id": 3,
      "title": "FC Basel",
      "items": [
          "language": "de",
          "fields": {
            "updated": "",
            "dateline": "Champions League, FC Basel",
            "short_name": "Die kleine Presseschau",
            "seo_title": "So ordnet nationale und internationale Presse den Sieg des FCB ein",

    A full list of fields in the json response is in the API reference.

  3. To get the comments for each article, make a GET request for each article to /rest-api/comments/article/{number}/{language}/nested, replacing {number} with the article number and {language} with the article language code. As usual, add the authentication parameters &access_token. A full request looks like this:

    And an extract of the response:

               "author":"Manuel Egli",
                   "name":"Manuel Egli",
               "subject":"Tolle Presseschau!",
               "message":"Vielen Dank f\u00fcr die tolle Presseschau \u00fcber den FCB-FCB Match von gestern. Generell finde ich, dass die TagesWoche sehr gute und interessante Presseschauen macht und zudem auch Tweets und Posts einbindet. Weiter so!",