Developers

GetContentsById

Usage

Use this method to retrieve the contents of several ids from the Knowledge Base.

client.getContentsById(contentsId:String,options:Object).then(function(response){
    //...
});

Mandatory parameters

Name Type Description
contentsId String Contents identifiers from the knowledge base separated by coma

Response data format

This method calls the Knowledge API’s GET /contents/ids 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 the contents with id 1,2 and 3:

// The parameter is the content id
client.getContentsById("1,2,3").then(function(response){
    response.data.results.forEach(function(result) {
        console.log(`Result(${result.id}): ${result.title}`);
    });
});