Developers

GetUserQuestionBySlug

Usage

Use this method to retrieve the user question of a certain slug from the knowledge base.

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

Mandatory parameters

Name Type Description
userQuestionSlug string User question slug from the Knowledge instance.

Options

This method does not have any options.

Response data format

This method calls the Knowledge API’s GET /user-questions/slug/{userQuestionSlug} 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 the user question with the slug "example-test":

// The parameter is the user question id
client.getUserQuestionBySlug('example-test').then(function(response){
    response.data.results.forEach(function(result) {
        console.log(`Result(${result.id}): ${result.title}`);
    });
});