List articles in an organisation

Endpoint

GET v1/organisations/{id}/articles

Request Parameters

field required type description
search no string Filter results based on a search string
status no string Filter on the status of the article (draft, ready, published). For example, to retrieve just draft and ready articles, this field should be draft,ready
flagged no boolean1 Filter to include only flagged articles
untagged no boolean1 Filter to include only untagged articles
start no2 date Date range start3 date to limit results on
end no2 date Date range end date3 to limit results on
updated_start no2 date Article updated date range start3 date to limit results on
updated_end no2 date Article updated date range end date3 to limit results on
limit no number How many records to return
offset no4 number If limiting, how many records to offset by. Combined with limit, this is useful for pagination
order no string The field and optional direction to order on. Fields that can be ordered on are title, date and created_date. To specify with a direction, use a pipe e.g. ?order=title

1As this is a GET method, the request data is presented as a query string. Therefore, booleans must be represented as 1 or 0.

2Both start date and end date are required to limit results by a date range. If one is provided and not the other, a 400 Bad Request will be returned.

3Dates are in the format YYYY-MM-DD HH:MM:SS.

4An offset can only be supplied with a limit.

Response Codes

200 OK Listed articles successfully
403 Not Authorised Not allowed to list the articles, probably not a member of the organisation

Response Body

An array of articles. See "Get an article" for the fields.

Example Response Body

[
    {
        "id": "p0o9i8u7",
        "title": "Peter Pan",
        "author": "Robin Hood",
        "lead": "Peter Pan is a character created by <em>Scottish novelist</em> and playwright J. M. Barrie.",
        "body": "<p>A <em>good<\\/em> body.<\\/p>",
        "date": "2013-01-01 00:00:00",
        "location": "Auckland, New Zealand",
        "status": "draft",
        "tags": [],
        "private_tags": [],
        "hero_image": null,
        "user": {
            "id": "i8u7y6t5",
            "first_name": "Dallas",
            "last_name": "Hauck",
            "avatar_url": "http:\\/\\/site.com\\/i.png",
            "last_active_date": "2014-04-22 01:02:03"
        },
        "created_date": "2014-04-20 01:03:04",
        "updated_date": "2014-04-20 01:05:23",
        "average_rating": 3.5,
        "flagged": false
    },
    ...
]

Count articles in an organisation

This endpoint is useful when combined with limiting and offsetting restraints when listing articles in an organisation. This endpoint accepts the same query as the listing endpoint does, but returns the total count of entities matched, as it's not possible to count the total when paginating.

Endpoint

GET v1/organisations/{id}/articles/count

Request Parameters