Developers

GetContentById

Usage

Use this method to retrieve the content of a certain id from the knowledge base.

client.getContentById(contentID:Integer,options:Object).then(function(response){
    //...
});

Mandatory parameters

Name Type Description
contentId integer Content identifier from the knowledge base. Minimum:0

Response data format

This method calls the Knowledge API’s GET /contents/{contentId} 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 all content bearing the id "1":

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