Use this method to retrieve data defined in the Knowledge instance:
// The first parameter is the data id
client.getData(dataId:String, options:Object).then(function(response){
//...
});
Name | Type | Description |
---|---|---|
dataId | string | Extra info group name identifier from the knowledge base. |
Name | Type | Default | Description |
---|---|---|---|
name | string | - | Name of the Extra Info element from the knowledge base. |
This method calls the Knowledge API’s GET /app/data/{dataId}
endpoint. Please refer to the Responses section of that endpoint on the Knowledge API Routes page for the response format.
The following example is set to retrieve data from the Extra Info group "app_lang":
// The first parameter is the data id
client.getData('app_lang', {
// name: ''
}).then(function(response){
response.data.results.forEach(function(result) {
console.log(`Result(${result.key})`);
});
});