Knowledge Base Operations
The Knowledge Base Operations API lets you explore how many categories your knowledge bases contain, what the categories are, and what specific articles are contained in a knowledge base.
Authorization
The operations carried out by the Knowledge Base Operations API can be accessed by all roles.
Complex Types
Category Complex Type
Field
|
Type
|
Comment
|
id
|
String
|
category identifier
|
kbId
|
String
|
knowledge base identifier
|
name
|
String
|
category name
|
CategoryNode Complex Type
Field |
Type |
Description
|
id |
String |
Category id
|
kbid |
String |
Knowledge base id
|
name |
String |
Category name
|
path |
String |
Category path
|
count |
Int |
Count of documents that are related to this category
|
childrenCategories |
CategoryNode [] |
Children categories
|
RelatedCategory Complex Type
Field |
Type |
Description
|
id |
String |
Category id
|
kbid |
String |
Knowledge base id
|
path |
String |
Category path
|
name |
String |
Category name
|
count |
Int |
Count of documents that are related to this category
|
KbCategoryTree Complex Type
Field |
Type |
Description
|
kbid |
String |
Knowledge base id
|
categories |
CategoryNode [] |
Categories that are related to this knowledge base
|
DocumentEntry Complex Type
Field
|
Type
|
Description
|
id
|
String
|
Unique document ID
|
kbId
|
String
|
Knowledge base ID
|
language
|
String
|
Document language
|
type
|
String
|
Document type (ARTICLE or QNA)
|
url
|
String
|
External URL associated with this document
|
media
|
String[]
|
List of media types associated with this document
|
tags
|
String[]
|
List of tags associated with this document
|
categories
|
String[]
|
List of categories associated with this document
|
relatedCategories
|
RelatedCategory [ ]
|
List of qualified category objects that are associated with this document
|
created
|
Date
|
Document creation date, represented as a string in the format of "yyyy-MM-dd HH:mm:ss"
|
modified
|
Date
|
Document modification date, represented as a string in the format of "yyyy-MM-dd HH:mm:ss"
|
customFields
|
Map<String, Object>
|
Set of custom field values
|
question
|
String
|
FAQ question (document type of QNA)
|
answer
|
String
|
FAQ answer (document type of QNA)
|
title
|
String
|
Article title (document type of ARTICLE)
|
description
|
String
|
Article description (document type of ARTICLE)
|
summary
|
String
|
Article summary (document type of ARTICLE)
|
DocumentContentEntry Complex Type
Field
|
Type
|
Description
|
All the fields of DocumentEntry
|
answerContentType
|
String
|
(FAQ) Content type for rich rendering content of answer from field answerContent
|
answerContent
|
String
|
(FAQ) May contain content of answer in rich markup format, for instance in form of “text/html”
|
descriptionContentType
|
String
|
(ARTICLE) Content type for rich rendering content of answer from field descriptionContent
|
descriptionContent
|
String
|
(ARTICLE) May contain content of description in rich markup format, for instance in form of “text/html”
|
attachments
|
String []
|
List of urls of attachments that are related to this document.
|
Field
|
Type
|
Description
|
from
|
int
|
Page offset
|
size
|
int
|
Page size
|
LocaleInformation complex type
Field
|
Type
|
Description
|
id
|
String
|
Locale identifier
|
name
|
String
|
Locale name
|
displayName
|
String
|
Locale display name
|
enabled
|
boolean
|
true if locale is enabled
|
isBase
|
boolean
|
true if this locale is base locale
|
hasRegions
|
boolean
|
true if this locale has regional sublocales
|
CategoryFacetItem
Field
|
Type
|
Description
|
id
|
String
|
unique category identifier
|
kbId
|
String
|
knowledge base identifier
|
name
|
String
|
name of category
|
count
|
String
|
How many documents refers to this category
|
API Reference
List of all available locales
Description
|
Retrieves list of all available locales
|
URL
|
/kbs/locales/
|
Method
|
GET
|
Request Content-Type
|
—
|
Response Content-Type
|
application/json
|
Role
|
Any
|
URL Identifiers
|
—
|
URL Parameters
|
Parameter
|
Type
|
Required
|
Default
|
Description
|
tenantId
|
String
|
Yes
|
—
|
Tenant identifier
|
|
Request
|
empty
|
Response
|
LocaleInformation [ ]
|
Notes
|
In case of success returns payload in response field of "response" of declared structure.
In case of error returns code and description of error.
|
List of knowledge bases
Description
|
retrieves list of knowledge bases supported
|
URL
|
/kbs/
|
Method
|
GET
|
Request Content-Type
|
|
Response Content-Type
|
application/json
|
Role
|
Any
|
URL Identifiers
|
None
|
URL Parameters
|
Parameter
|
Type
|
Required
|
Default
|
Description
|
lang
|
String
|
No
|
—
|
Optional parameter for retrieving metadata of those knowledge bases that have specified language. In case of omitting parameter of "lang" the metadata of all configured knowledge bases will be retrieved.
|
sessionId
|
String
|
No
|
—
|
session identifier
|
tenantId
|
String
|
Yes
|
—
|
Tenant identifier
|
|
Request
|
empty
|
Response
|
|
Notes
|
In case of success returns payload in response field of "response" of declared structure.
In case of error returns code and description of error.
|
Get knowledgebase document categories
Description
|
get list of categories
|
URL
|
/kbs/{kbId}/categories
|
Method
|
GET
|
Request Content-Type
|
—
|
Response Content-Type
|
application/json
|
Role
|
Any
|
URL Identifiers
|
Parameter
|
Type
|
Description
|
{kbId}
|
String
|
Knowledgebase identifier
|
|
URL Parameters
|
Parameter
|
Type
|
Required
|
Default
|
Description
|
lang
|
String
|
Yes
|
"_default"
|
Language
|
sessionId
|
String
|
No
|
—
|
session identifier
|
media
|
String
|
No
|
any
|
Interaction media identifier
|
tenantId
|
String
|
Yes
|
—
|
Tenant identifier
|
|
Request
|
empty
|
Response
|
Field
|
Type
|
Description
|
categories
|
CategoryFacetItem[]
|
List of categories for given knowledgebase
|
|
Notes
|
In case of success returns payload in response field of "response" of declared structure.
In case of error returns code and description of error.
|
Get federated categories
Description
|
get list of categories
|
URL
|
/kbs/langs/{lang}/categories
|
Method
|
POST
|
Request Content-Type
|
—
|
Response Content-Type
|
application/json
|
Role
|
Any
|
URL Identifiers
|
Identifier
|
Type
|
Description
|
lang
|
String
|
Language identifier
|
|
URL Parameters
|
Parameter
|
Type
|
Required
|
Default
|
Description
|
sessionId
|
String
|
No
|
—
|
session identifier
|
media
|
String
|
No
|
any
|
Interaction media identifier
|
tenantId
|
String
|
Yes
|
—
|
Tenant identifier
|
|
Request
|
KnowledgeBaseListRequest
|
Response
|
Parameter
|
Type
|
Description
|
categories
|
CategoryFacetItem[]
|
list of categories for given knowledgebase
|
|
Notes
|
In case of success returns payload in response field of "response" of declared structure.
In case of error returns code and description of error.
|
Get federated categories tree
Description
|
get list of categories
|
URL
|
/kbs/langs/{lang}/categories/tree
|
Method
|
POST
|
Request Content-Type
|
—
|
Response Content-Type
|
application/json
|
Role
|
Any
|
URL Identifiers
|
Identifier
|
Type
|
Description
|
lang
|
String
|
Language identifier
|
|
URL Parameters
|
Parameter
|
Type
|
Required
|
Default
|
Description
|
sessionId
|
String
|
No
|
—
|
session identifier
|
media
|
String
|
No
|
any
|
Interaction media identifier
|
tenantId
|
String
|
Yes
|
—
|
Tenant identifier
|
|
Request
|
KnowledgeBaseListRequest
|
Response
|
KbCategoryTree[ ]
|
Notes
|
In case of success returns payload in response field of "response" of declared structure.
In case of error returns code and description of error.
|
Get knowledgebase documents associated with given category
Description
|
get all document previews in category
|
URL
|
/kbs/{kbId}/{catId}/documents
|
Method
|
GET
|
Request Content-Type
|
—
|
Response Content-Type
|
application/json
|
Role
|
Any
|
URL Identifiers
|
Parameter
|
Type
|
Description
|
{kbId}
|
String
|
Knowledgebase identifier
|
{catId}
|
String
|
specific category identifier
|
|
URL Parameters
|
Parameter
|
Type
|
Required
|
Default
|
Description
|
from
|
int
|
No
|
0
|
Start position for pagination, default=0
|
size
|
int
|
No
|
10
|
Size of page for pagination, default=10
|
lang
|
String
|
Yes
|
"_default"
|
Language identifier
|
sessionId
|
String
|
No
|
—
|
Session identifier
|
media
|
String
|
No
|
any
|
Interaction media type
|
tenantId
|
String
|
Yes
|
—
|
Tenant identifier
|
|
Request
|
empty
|
Response
|
Field
|
Type
|
Description
|
count
|
int
|
total count of documents in selection (pagination-independent)
|
page
|
Pagination
|
pagination information
|
documents
|
DocumentEntry []
|
result selection of document
|
categories
|
CategoryFacetItem[]
|
Facet selection of categories, related to selected documents set
|
relatedCategories
|
KbCategoryTree[ ]
|
Tree of categories that are related to selected set of documents
|
|
Notes
|
In case of success returns payload in response field of "response" of declared structure.
In case of error returns code and description of error.
|
Get top X trending documents
Description
|
get top X trending documents
|
URL
|
/kbs/{kbId}/top
|
Method
|
GET
|
Request Content-Type
|
—
|
Response Content-Type
|
application/json
|
Role
|
Any
|
URL Identifiers
|
Parameter
|
Type
|
Description
|
{kbId}
|
String
|
Knowledgebase identifier
|
|
URL Parameters
|
Parameter
|
Type
|
Required
|
Default
|
Description
|
lang
|
String
|
Yes
|
"_default"
|
Language identifier
|
size
|
int
|
No
|
10
|
Size of page for pagination, default=10
|
sessionId
|
String
|
No
|
—
|
Session identifier
|
media
|
String
|
No
|
any
|
Interaction media type identifier
|
tenantId
|
String
|
Yes
|
—
|
Tenant identifier
|
|
Request
|
empty
|
Response
|
Field
|
Type
|
Description
|
count
|
int
|
total count of documents in selection (pagination-independent)
|
documents
|
DocumentEntry []
|
result selection of document
|
|
Notes
|
In case of success returns payload in response field of "response" of declared structure.
In case of error returns code and description of error.
|
Get federated top X trending documents
Description
|
get top X trending documents
|
URL
|
/kbs/langs/{lang}/top/
|
Method
|
POST
|
Request Content-Type
|
—
|
Response Content-Type
|
application/json
|
Role
|
Any
|
URL Identifiers
|
Parameter
|
Type
|
Description
|
{lang}
|
String
|
Language identifier
|
|
URL Parameters
|
Parameter
|
Type
|
Required
|
Default
|
Description
|
size
|
int
|
No
|
10
|
Size of page for pagination, default=10
|
sessionId
|
String
|
No
|
—
|
Session identifier
|
media
|
String
|
No
|
any
|
Interaction media type identifier
|
tenantId
|
String
|
Yes
|
—
|
Tenant identifier
|
|
Request
|
KnowledgeBaseListRequest
|
Response
|
Field
|
Type
|
Description
|
count
|
int
|
total count of documents in selection (pagination-independent)
|
documents
|
DocumentEntry []
|
result selection of document
|
|
Notes
|
In case of success returns payload in response field of "response" of declared structure.
In case of error returns code and description of error.
|
Get full content of document
Description
|
get full content of particular document
|
URL
|
/kbs/{kbId}/documents/{docId}
|
Method
|
GET
|
Request Content-Type
|
—
|
Response Content-Type
|
application/json
|
Role
|
Any
|
URL Identifiers
|
Parameter
|
Type
|
Description
|
{kbId}
|
String
|
Knowledgebase identifier
|
{docId}
|
String
|
Unique document identifier
|
|
URL Parameters
|
Parameter
|
Type
|
Required
|
Default
|
Description
|
lang
|
String
|
Yes
|
"_default"
|
Language identifier
|
sessionId
|
String
|
No
|
—
|
Session identifier
|
tenantId
|
String
|
Yes
|
—
|
Tenant identifier
|
|
Request
|
empty
|
Response
|
DocumentEntry
|
Notes
|
In case of success returns payload in response field of "response" of declared structure.
In case of error returns code and description of error.
|
Retrieve Knowledge Base Information
Description
|
Retrieves information about a specific knowledge base (including supported languages)
|
URL
|
/kbs/{kbId}
|
Method
|
GET
|
Request Content-Type
|
—
|
Response Content-Type
|
application/json
|
Role
|
Any
|
URL Identifiers
|
Parameter
|
Type
|
Description
|
{kbId}
|
String
|
Knowledge base ID
|
|
URL Parameters
|
Parameter
|
Type
|
Required
|
Default
|
Description
|
sessionId
|
String
|
No
|
|
Session ID
|
tenantId
|
String
|
Yes
|
—
|
Tenant identifier
|
|
Request
|
Empty
|
Response
|
KnowledgeBaseMeta
|
Retrieve categories from all knowledge bases
Description
|
get list of categories
|
URL
|
/kbs/categories
|
Method
|
POST
|
Request Content-Type
|
—
|
Response Content-Type
|
application/json
|
Role
|
Any
|
URL Identifiers
|
—
|
URL Parameters
|
Parameter
|
Type
|
Required
|
Default
|
Description
|
lang
|
String
|
No
|
"_default"
|
Language
|
sessionId
|
String
|
No
|
—
|
Session identifier
|
tenantId
|
String
|
Yes
|
—
|
Tenant identifier
|
|
Request
|
list of knowledge base identifiers
|
Response
|
CategoryFaceItem
|
Notes
|
If successful, 200 OK is sent back as response. If the dataset already exists, 400 BAD REQUEST is sent back
|