Knowledge base methods
VariableKnowledge Base methods
Getting knowledge base sections:
Returns an array of sections - [BaseCollection]
Example:
usedesk.getCollections(connectionStatus: {success, collections, error
})
Getting the article:
Returns the article class - Article
| Variable | Type | Description |
|---|---|---|
| articleID | Int | article id |
Example:
usedesk?.getArticle(articleID: id, connectionStatus: { success, article, error
})
Getting article search results:
Returns the class of the search result - SearchArticle
| Variable | Type | Description |
|---|---|---|
| collection_ids | [Int] | Id of sections separated by commas |
| category_ids | [Int] | Category id separated by commas |
| article_ids | [Int] | Id of articles separated by commas |
| count | Int | Number of articles per page (maximum: 100, default: 20) |
| page | Int | Page (default 1) |
| query | String | Search query string that searches by the title and text of the article |
| type | TypeArticle(.all .open .close) | All articles are displayed. If the article is public, but is in a private category, then when requested with type = open it will not be displayed, because it will be considered private due to the parent category |
| sort | SortArticle (.id .title .category_id .public .created_at) | Parameter by which articles are sorted |
| order | OrderArticle (.asc .desc) | The sort order by the sort parameter. default: asc. Options: asc - ascending, desc - descending. |
Example:
usedesk.getSearchArticles(collection_ids: [collection_ids], category_ids: [category_ids], article_ids: [], query: "searchText", type: .all, sort: .title, order: .asc) { (success, searchArticle, error)
})
Adding an article view indicator:
| Variable | Type | Description |
|---|---|---|
| articleID | Int | article id |
| count | Int | number of views |
Example:
usedesk.addViewsArticle(articleID: id, count: 1, connectionStatus: { success, error in
})