Developers

GetData

Usage

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){
    //...
});

Mandatory parameters

Name Type Description
dataId string Extra info group name identifier from the knowledge base.

Options

Name Type Default Description
name string - Name of the Extra Info element from the knowledge base.

Response data format

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.

Example

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})`);
    });
});