List of articles
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.
* — 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:
|
type |
Filtering by article visibility
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:
By default: ID |
order |
Order of sorting by sort option
By default: asc |
$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;
{ "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
|