Skip to content

Instantly share code, notes, and snippets.

@dzabrzenski
Last active March 14, 2018 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dzabrzenski/68dc6b7df10efcc6b4ec68f2bf7f8cbe to your computer and use it in GitHub Desktop.
Save dzabrzenski/68dc6b7df10efcc6b4ec68f2bf7f8cbe to your computer and use it in GitHub Desktop.

Machine learning

Authorization

Include this HTTP header for each API request:

Authorization: Bearer ${ACCESS_TOKEN}

Endpoints

POST /articles

Creates a new article.

Properties

Property Type Description
id String Article id in KnowledgeBase API. Required.
title String Article title. Required.
text String Article plaintext. Required.
topic Array.<String> Array of topics which are used to recognize the article. Default: []
tags Array.<String> Array of tags which are used to recognize the article. Default: []
questions Array.<String> Trained questions for model. Default: []
visibility String Visibility of the article. Default: public
url String Article URL. Default: ""

Example payload:

{
  id: "",
  title: "Title"
  text: "Plaintext",
  topic: ["Topic name"],
  tags: ["tag1", "tag2", "tag3"],
  visibility: "public / internal / draft",
  url: "article public URL"
}

PUT /articles/:id

Example payload:

{
  title: "Article title"
  text: "Article text content",
  topic: ["Topic name"],
  tags: ["tag1", "tag2", "tag3"],
  visibility: "public / internal / draft",
  url: "article public URL"
}

DELETE /articles/:id

Training

POST /articles/:id/train

Train specific article.

Properties

Property Type Description
questions Array.<String> Array of questions which are used to recognize the article. Required.

Classification

POST /query

Properties

Property Type Description
questions Array.<String> Array of questions which are used to recognize the article. Required.

Example payload:

{
  query: [
    "Do you support custom domains",
    "What kind of pricing do you have",
    "Im interested in your product", 
    "Hi"
  ]
}

Example response:

[
  { 
    id: "", 
    question: "Do you support custom domains?",
    title: "Setting up custom domain",
    description: "", // first 120 characters
    url: "https://help.knowledgebase.ai/general/setting-up-custom-domain"
  },
  ...
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment