Articles module

This module provides access to articles. You can list either retrieve lists of articles or a single article. Multiple methods are supported.

In case a content piece is protected by a paywall, you can include a Visitor token to request a full version of the article.

URL Format

You can use GET or POST variables in your requests.

baseUrl/articles.php?action=ACTION&params...

When the visitor token is required, add

&token=TOKEN_HERE

Reference

Some responses may return defined objects inside the JSON that refer to existing classes.

See related:

Acceptable output types

Single article requests return a full-sized version of an article object. It can be output in two formats:

Article lists are somewhat more compact, and can be output in more formats, compatible with standard readers:

We will only define the JSON output in this documentation. Other outputs are either standard or can be consulted from the third-party owner's documentation.

List of actions

The parameter "action" determines the action you would like to match. See below list.

list

List articles by search filters. This is your go-to command.

In here, you will use object signatures, which are made of the class name, followed by a colon, followed by the ID of the object. For example, Category:1 means Category ID 1.

You will also see the type parameter. The followed types are available by default: stream, contents. "stream" is used for the infinite stream functionality, and the "contents" is the issue-category linking functionality. Additional types can be created from the backend in the dynamic sections of a Page.

Parameters:

Response:

In case of format=json, response will be:

{
    error: true/false,
    data: [ Object, ... ],
    total: int (total results count),
    htmlPrepend: string,
    htmlAppend: string
}

In case of other formats, they will be returned in their standard specification.

Some examples

If you would like to get the latest 20 articles in Category ID 1, you would perform this request:

/cmsapi/articles.php?key=KEY&action=list&signature=["Category:1"]&limit=20&text=0&page=1

If you would like to get all featured articles on Page ID 1, you would perform this request:

/cmsapi/articles.php?key=KEY&action=list&signature=["Page:1"]&type=featured&limit=20&text=0&page=1

If you would like to get all featured articles on Page ID 1, followed by the top 20 articles in Category ID 1, you would perform this request:

/cmsapi/articles.php?key=KEY&action=list&signature=["Page:1","Category:1"]&type=featured&limit=20&text=0&page=1

Search for articles via a user-provided query.

Parameters:

Response:

In case of format=json, response will be:

{
    error: true/false,
    data: [ Object, ... ],
    total: int (total results count),
    htmlPrepend: string,
    htmlAppend: string
}

view

Get one article by ID.

Parameters:

Return:

{
    data: [{
            Article object
        }],
    htmlPrepend: Optional HTML to be prepended when displayed
    htmlAppend: Optional HTML to be appended when displayed (deprecated)
}        

preview

Get a draft version of an article.

Parameters:

Return: see view request

mostread

Get the most-read articles automatically generated every 15 minutes at most. You can filter by various optional filters.

Parameters:

Available types:

Return:

{
    data: [{ Article object}]
    htmlPrepend: string,
    htmlAppend: string, 
}

add

Add an article. For internal use at the moment. You may need this if your frontend allows visitors to submit articles for review.

add_comment

Add a comment on an article.

Parameters:

Supported file extensions: Videos (mp4, m4v, avi, mov), Images (jpg, jpeg, png), Audio (mp3, m4a).

Return:

No additional return parameters. Only error=true in case of a failure.

list_comments

List approved comments for an article.

Parameters:

Return:

    data: [ { Comment object } ]