List of articles

GET https://secure.usedesk.com/uapi/support/{account_id}/articles/list , {account_id} — Knowledge base ID in the system

Warning. If you use the server version of Usedesk, you will have a different URL of methods. Check the URL for the API with our team — support@usedesk.com.

The method returns a list of articles

* — required fields

Parameter

Value

api_token* Channel API token
collection_ids

Section IDs

Allowed to pass multiple values separated by commas

category_ids

Category IDs

Allowed to pass multiple values separated by commas

article_ids

Article IDs

Allowed to pass multiple values separated by commas

count

Number of articles per page

By default: 20

Maximum: 100

page

Page number

By default: 1

query

Search string

Search by title and text of the article

short_text

Parameter that allows to display trimmed search result

Only works in combination with query. This means that if you don't search for anything, the text will be full even if short_text=1

Possible values:

  • 0 — display full text (default);
  • 1 — output the trimmed result.
type

Filtering by article visibility

  • public;
  • private.

By default, all articles are listed.

The privacy of the parent category is considered. That is, if the category of the article is public, but the parent category is private, it will not appear in the output with type=public

sort

Criteria for sorting articles

Possible options:

  • id — Article ID
  • title — Title
  • category_id — Category ID
  • public — Article visibility
  • created_at — Creation date

By default: ID

order

Order of sorting by sort option

  • asc — ascending
  • desc — по descending

By default: asc


PHP request example
$baseId = 2;
$data = array(
    'api_token'=> 'e1cbe1c1c9d910ef2ae975215644cb53dd555de4',
    'query' => 'как',
    'count' => 2
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://secure.usedesk.com/uapi/support/'. $baseId .'/articles/list?' . http_build_query($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_close($curl);
return $result;
        


Example of a response from server
{
    "page": 1,
    "last-page": 5,
    "count": 2,
    "total-count": 10,
    "articles": [
        {
            "id": 96,
            "title": "How to sign in",
            "text": "\u003Cp\u003EPress \u003Cem\u003EStart \u003C\/em\u003E\u003Cbr\u003EFill in all the fields\u003Cbr\u003EConfirm your phone number\u003Cbr\u003ECheck your email \u003C\/p\u003E\u003Cp\u003Eprivate\u003C\/p\u003E",
            "public": 0,
            "order": 4,
            "is_rating": 0,
            "rating": {
                "positive": 0,
                "negative": 0
            },
            "category_id": 34,
            "collection_id": 123,
            "views": 23,
            "created_at": "2017-08-02 06:14:41"
        }, {
            "id": 98,
            "title": "How to sign in 2",
            "text": "\u003Cp\u003EPress \u003Cem\u003EStart \u003C\/em\u003E\u003Cbr\u003EFill in all the fields\u003Cbr\u003EConfirm your phone number\u003Cbr\u003ECheck your email \u003C\/p\u003E",
            "public": 1,
            "order": 2,
            "is_rating": 0,
            "rating": {
                "positive": 0,
                "negative": 0
            },
            "category_id": 34,
            "collection_id": 123,
            "views": 46,
            "created_at": "2017-09-21 17:47:50"
        }
    ]
}
        


Server response description

Parameter Description
page Current page
last-page Number of articles per page
count Number of pages
total-count Total number of articles
articles Array with articles
Parameter
Description
id Article ID
title Article Title
text Text of article
public Flag indicating the publicity of the article
active_until Дата, до которой статья будет активна
date The date until which the article will be active
timezone_type Time zone type
timezone Time Zone
order Порядок отображения статьи
is_rating Flag indicating the ability to rate the article
rating Rating array
  • positive — positive ratings number;
  • negative — negative ratings number
category_id Category ID
category_title Category name
collection_id Section ID
collection_image Section image
views Number of views
created_at Creation date