Sourcefabric Manuals

 English |  Español |  Français |  Italiano |  Português |  Русский |  Shqip

Newscoop 4.2 Cookbook

Newscoop API SDK's

Newscoop REST API have two official sdk's:

PHP SKD

PHP-SDK is a library that simply allows access to the Newscoop REST API. You can easily install it in any php project with Composer

There is realy great simple tutorial where you can see and try how to work with this sdk: http://mikolajczuk.tumblr.com/post/34632137832/newscoop-rest-api-sdk-usage

JS SDK

Use Newscoop REST API easly in Your Newscoop theme templates with Java Script. 

First you must include small library (you can find newscoop.js file on JS SDK github repository. 

<script src="newscoop.js"></script>

After this you can start use it:

var api = new NewscoopRestApi('http://newscoop.dev/api');

api.getResource('/articles', {'type': 'news'})
    .setItemsPerPage(5)
    .setOrder({'number': 'asc'})
    .makeRequest(function(res){
        // callback
    });

With this example You will have data (inside makeRequest callback function, under res variable) for 5 latest articles with "news" type.

There has been error in communication with Booktype server. Not sure right now where is the problem.

You should refresh this page.