List of directories and categories

GET https://api.usedesk.ru/support/{account_id}/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.

Method returns the list of sections and categories in the Knowledge Base

* — required fields

Parameter
Value
api_token* Channel API token


PHP request example

$baseId = 2;
$data = array(
    'api_token'=> 'e1cbe1c1c9d910ef2ae975215644cb53dd555de4',
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.usedesk.ru/support/'. $baseId .'/list?' . http_build_query($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_close($curl);
return $result;
        


The order of articles, categories and collections depends on their order at the system.

Example of a response from server
[
    {
        "id": 26,
        "title": "section",
        "public": 1,
        "order": 0,
        "image": "https://secure.usedesk.ru/upload/support/2/42/15427483037735cb7bb7f6a11874125e83c7d2ece15bf4788fd5f40.png",
        "categories": [
            {
                "id": 34,
                "title": "category",
                "public": 1,
                "order": 1,
                "articles" : {
                    {
                        "id" : 1,
                        "title" : "Article 1",
                        "views": 23
                        "rating": {
                            "positive": 5,
                            "negative": 1
                        },
                    },
                    {
                        "id" : 2,
                        "title" : "Article 2",
                        "views": 46
                        "rating": {
                            "positive": 2,
                            "negative": 3
                        },
                    }
                }
            },
            {"id": 38, "title": "category 2", "public": 1, "order": 2, "articles": {}},
            {"id": 40, "title": "category 3", "public": 0, "order": 3, "articles": {}},
            {"id": 42, "title": "category 4", "public": 1, "order": 4, "articles": {}},
            {"id": 44, "title": "category 5", "public": 0, "order": 5, "articles": {}},
        ]
    },
    {
        "id": 38,
        "title": "section 2",
        "public": 1,
        "order": 0,
        "categories": [
            {"id": 70, "title": "category ", "public": 0, "order": 1, "articles": {}},
            {"id": 72, "title": "category 2", "public": 1, "order": 2, "articles": {}},
            {"id": 74, "title": "category 3", "public": 1, "order": 3, "articles": {}},
            {"id": 76, "title": "category 4", "public": 1, "order": 4, "articles": {}},
            {"id": 78, "title": "category 5", "public": 1, "order": 5, "articles": {}},
        ]
    }
]
        


Server response parameters

Parameter Description
id Section ID
title Title of section
public Flag indicating the visibility of the section
order Section display order
image Section icon URL
categories Array of categories

Parameter
Description
id Category ID
title Category name
description Category Description
public Flag for category visibility
order Category display order
articles Array of articles in a category
Parameter
Description
id Article ID
title Article title
views Number of views on the article
rating Article scores
  • positive;
  • negative