KustomerCore.getCategories()
Fetches the categories in your Kustomer Knowledge Base
First, initialize chatYou must initialize with
KustomerCore.init()before you can execute any additional Core SDK methods
Examples
// Gets your categories for a certain knowledge base
KustomerCore.getCategories({
lang: 'en_us',
knowledgeBaseId: 'SOME_ID'
}, function (callbackResponse, error) {
console.log('Fetched categories!');
});Syntax
KustomerCore.getCategories(options, function(callbackResponse, error))| Parameter | Type | Description |
|---|---|---|
| options | Object | Required An object containing details about the categories you want to fetch. A breakdown of the |
| function(callbackResponse, error) | Function | Optional A callback that is run after the method completes. callbackResponse is an object returned to the callback function. See the error is either |
options
options| Property | Type | Description |
|---|---|---|
| knowledgeBaseId | String | Required The unique ID of the knowledge base. |
| lang | String | Required The language code of the categories to fetch. |
callbackResponse
callbackResponse| Property | Type | Description |
|---|---|---|
| categories | Object | Required An object with its keys being category IDs and values being the category object. These category objects have the same structure as |
| rootCategory | Object | Required The root category object. See below for what the |
rootCategory
rootCategory| Property | Type | Description |
|---|---|---|
| categoryId | String | Required The unique ID of the category |
| title | String | Optional The category's title. |
| description | String | Optional The category's description. |
| parentCategory | String | Optional The parent category's ID. |
| childCategories | Array | Required An array of child category IDs. |
Updated 16 days ago