KustomerCore.getArticleById()

Fetches one article by id in your knowledge base

👍

First, initialize chat

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

Examples

// Gets an article by ID
KustomerCore.getArticleById({
  articleId: 'SOME_ID',
  lang: 'en_us',
  knowledgeBaseId: 'SOME_ID'
}, function (callbackResponse, error) {
  console.log('Fetched article!');
});

Syntax

KustomerCore.getArticleById(options, function(callbackResponse, error))
ParameterTypeDescription
optionsObjectRequired

An object containing details about the article you want to fetch. A breakdown of the options object is listed below.
function(callbackResponse, error)FunctionOptional

A callback that is run after the method completes.

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
knowledgeBaseIdStringRequired

The unique ID of the knowledge base.
langStringRequired

The language code of the categories to fetch.
articleIdStringRequired

The article ID you want to fetch for.

callbackResponse

PropertyTypeDescription
articleIdStringRequired

The unique ID of the article.
htmlBodyStringRequired

The article's html body.
titleStringRequired

The article's title.
descriptionStringRequired

The article's description.
updatedAtStringRequired

The article's last updated at timestamp.
langStringRequired

The article's language code.
slugStringRequired

The article's slug for its url.
versionStringRequired

The version of the article.
hashStringRequired

The article's hash code.
kbUrlStringOptional

The article's knowledge base URL.
knowledgeBaseIdStringOptional

The article's knowledge base ID.