KustomerCore.submitArticleFeedback()

Submits the response of an article feedback form.

👍

First, initialize chat

You must initialize with KustomerCore.init() before you can execute any additional Core SDK methods

Examples

// Submit a satisfaction form
KustomerCore.submitArticleFeedback({
  articleId: 'SOME_ID',
  rating: 'positive',
  knowledgeBaseId: 'SOME_KB_ID',
  lang: 'en_us',
}, function (res, error) {
  console.log('Submitted article feedback!');
});

Syntax

KustomerCore.submitSatisfactionForm(options, function(callbackResponse, error))
ParameterTypeDescription
optionsObjectOptional

An options object allowing you to modify this method call. All possible options are listed below.
function(callbackResponse, error)FunctionOptional

A callback that is run after the completion of this method.

callbackResponse is an object returned to the callback function. See the callbackResponse section below to see the properties of the object.

error is either undefined or a native JavaScript Error object.

options

PropertyTypeDescription
articleIdStringRequired

The unique ID of the article.
ratingStringRequired

The rating for the article. Can be 'positive' or 'negative'.
knowledgeBaseIdStringRequired

The unique ID of the knowledge base.
langStringThe article's language code.

callbackResponse

// callbackResponse

{
  attributes: {
    rating: 'positive' | 'negative';
    suggestedReasons?: string[];
    writtenFeedback?: string;
  };
  id: string;
}