Knowledge Base public API

Edited

Overview

When you publish an external knowledge base, we automatically generate a static, publicly available API for you and your customers. There is no authentication required to access this API since it only lists content that is already available in your knowledge base.

This API also includes a slimmed down version of the article page only containing the article itself. 

Looking for CRUD API documentation? Visit our Developer Portal for a complete CRUD API for both internal and external knowledge bases.


Resources available in the API

  • Published articles

  • Categories

    • Private categories are accessible via direct link only, and will otherwise be unlisted and unavailable via search

  • Resource links

  • Sections


Routes and responses

Note: Ids are only unique across the same resource type but can overlap. For example, you could have an article with an id of 1 and a category with an id of 1.

/en/home.json

This is the base route you can use which lists your home page and base knowledge base information. The content of the response would be:

{
  "type": "home",
  "name": "<Your knowledge base name>",
  "favicon_url": "<Link> or null",
  "logo_url": "<Link> or null",
  "content_url": "/",
  "json_content_url": "/en/home.json",
  "content": ["<Array of content>"] // View details below
}

/en/categories/1-category-name.json

See /en/categories/1.json.

/en/categories/1.json

This route allows you to fetch details about any category. If a category is marked as private it will not appear in any content array but can be requested if you know the correct id. 

Note: Anything after the id of the category in the url is optional (besides the .json).

{
 "id": 1,
  "name": "<Name of category>",
  "sub_articles_count": 1, // Count of sub articles
  "sub_categories_count": 1, // Count of sub categories
  "icon_svg": "<Svg content for icon>", // This file is control only by Front
  "content_url": "/en/categories/1-category-name",
  "json_content_url": "/en/categories/107-category-name.json",
  "content": ["<Array of content>"] // View details below
}

/en/articles/1.json

This route allows you to get a json representation of the article. The html_content contains no styles, so if you render that directly you will need to style the content yourself, or you can use the slim version of the article.

Note: The parent_category_id does not mean the article is a child of that category, as it could be contained in a section. Since you can’t navigate directly to a section, we list the nearest category. If the category is not defined, the article is located on the home page.

{

    "id": 1,
    "name": "<Name of article>",
    "last_edited": 1692993973903, // Timestamp in ms
    "content_url": "/en/articles/1",
    "slim_content_url": "/en/articles/1.slim",
  // Link to this articles parent category (ignores sections). If this is not defined
  // that means it is on the home page.
    "parent_category_id": 1,
    "text_content": "<Content of the article in text form>",
    "html_content": "<Content of the article in HTML form>",
    "attachments": [
      {
            // Unqiue id for the attachment.
            "id": "cd38bffa-b955-4e71-976e-cf3b62384d20",
            "content_type": "text/plain", // Content type of the attachment
            "size": 608, // Size of the attachment in bytes
            "url": "<Url to access attachment>"
      }
  ]
}

/en/articles/1.slim

This returns a slimmed down version of the article with styles that match what is rendered in your knowledge base. This is a very limited version of the article and does not include anything that is not required to render the article itself. 

Example: Google Analytics would not be included on this page.

Content

Whenever a response contains content it contains an array of one or more of any of the following items.

Article Content Response

{
  "type": "article",
  "id": 1, // Unqiue ID for the article
  "name": "<Name of article>",
  "last_edited": 1692728271964, // Timestamp in ms
  "content_url": "/en/articles/1",
  "slim_content_url": "/en/articles/1.slim",
  "content_preview": "<Short preview of the content>",
  "json_content_url": "/en/articles/1.json"
}

Category Content Response

{
  "type": "category",
  "id": 2, // Unqiue ID for the category
  "name": "<Name of category>",
  "sub_articles_count": 1, // Count of sub articles
  "sub_categories_count": 1, // Count of sub categories
  "icon_svg": "<Svg content for icon>", // This file is control only by Front.
  "content_url": "/en/categories/2-category-name",
  "json_content_url": "/en/categories/2-category-name.json"
}

Resource Link Content Response

{
  "type": "resource_link",
  "id": 3, // Unqiue ID for the category
  "name": "<Name of resource link>",
  "link": "<Link>",
  "icon_svg": "<Svg content for icon>", // This file is control only by Front.
}

Section Content Response

{
  "type": "section",
  "id": 4, // Unqiue ID for the section
  "name": "<Name of section>",
  "content": ["<Array of content>"] // Can not contain another section.
}

FAQ

Why am I missing a JSON or SLIM version?

Make sure you have recently published your knowledge base, as we only generate these files when you publish your knowledge base.

Can I use this API for an unpublished knowledge base?

No. This API is only available for published external knowledge bases at this time.

Can I use this API for a published internal knowledge base?

No. This API is only available for published external knowledge bases at this time.

Can I export all my knowledge base data?

No. We don't currently support knowledge base data exports.