Developers

GetContentRelated

Usage

Use this method to retrieve related contents for a specific content id:

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

Mandatory parameters

Name Type Description
contentId integer Content identifier from the Knowledge Base. Minimum:0

Options

Name Type Default Description
length integer 5 Maximum number of items that may be returned in a collection. Minimum:1. Max:100

Response data format

This method calls the Knowledge API’s GET /contents/{contentId}/related endpoint. Please refer to the Responses section of that endpoint on the Knowledge API Routes page for the response format.

Example

The following example retrieves related content for all content bearing the id "1":

client.getContentRelated(1,{
    length:1
}).then(function(response){
    response.data.results.forEach(function(result) {
        console.log(`Result(${result.id}): ${result.title}`);
    });
});