KustomerCore.submitSatisfactionForm()

Submit the response of a satisfaction 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.submitSatisfactionForm({
  satisfactionId: 'SOME_ID',
  rating: 8,
  answers: [{prompt:'Any feedback?', answer: 'Very helpful and clear.', id: "SOME_QUESTION_ID"}],
  submittedAt: '2021-01-27T22:46:49.030Z',
}, function (res, error) {
  console.log('Submitted satisfaction form!');
});

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
satisfactionIdStringRequired

The satisfaction form unique ID.
ratingNumberOptional

A numerical rating scoring the customer's satisfaction.
answersArrayOptional

The text feedback that the customer submitted in the satisfaction form.
submittedAtStringRequired

An ISO string Date value that you can generate through new Date().toISOString()

callbackResponse

// callbackResponse

{
  conversationId: String,
  satisfactionId: String,
  timetoken: String,
  form: {
    description: String,
    introduction: String,
    name: String,
    followupQuestion: String,
    ratingPrompt: String,
    scale: {
      options: String,
      labelLow: String,
      labelHigh: String,
      type: String,
    },
  },
  response: {
    rating: Number,
    followupAnswer: String,
  },
}