Skip to content

Knowledge

API Authorization

NOTE

  • To obtain the AUTH_TOKEN, please refer to the Authorization section and find the AUTH_TOKEN section.
  • Please make sure that all API requests include the AUTH_TOKEN in the request header, as shown below:

SDK Authorization

NOTE

  • Before integrating the SDK, please make sure that you have obtained the APP_ID and APP_KEY.
  • To obtain the APP_ID and APP_KEY, please refer to the Authorization section and find the Obtain APP_ID & APP_KEY section.

Knowledge Base

API Request

  • Example
  • Field description
Parameter NameTypeRequiredDescription
pageIntegerNPage number, starting from 0.
sizeIntegerNNumber of records to return per page.
keywordStringNKeyword to search for.

API Response

  • Example
  • Field description
Parameter NameTypeRequiredDescription
pageNumIntegerYPage number, starting from 0.
pageSizeIntegerYNumber of records to return per page.
totalIntegerYTotal number of records.
pagesIntegerYTotal number of pages.
currentPageTotalIntegerYNumber of records returned in the current page.
contentArray<Object>YContent of the knowledge base list.
content.idIntegerYUnique identifier for the knowledge base.
content.nameStringYName of the knowledge base.
content.descriptionStringYDescription of the knowledge base.
content.statusStringYStatus of the knowledge base.
ENABLED/DISABLED
content.totalDocIntegerYTotal number of documents in the knowledge base.
content.totalRecordIntegerYTotal number of records in the knowledge base.
content.createDatetimeTimestampYCreation time of the knowledge base.
content.updateDatetimeTimestampYUpdate time of the knowledge base.

Knowledge Doc

API Request

  • Example
  • Field description
Parameter NameTypeRequiredDescription
pageIntegerNPage number, starting from 0.
sizeIntegerNNumber of records to return per page.
keywordStringNKeyword to search for.
knowledgeBaseIdIntegerYUnique identifier for knowledge base.

API Response

  • Example
  • Field description
Parameter NameTypeRequiredDescription
pageNumIntegerYPage number, starting from 0.
pageSizeIntegerYNumber of records to return per page.
totalIntegerYTotal number of records.
pagesIntegerYTotal number of pages.
currentPageTotalIntegerYNumber of records returned in the current page.
contentArray<Object>YContent of the knowledge base documents
content.idIntegerYUnique identifier for the knowledge base document.
content.nameStringYName of the knowledge base document.
content.typeStringYType of the knowledge base document.
TEXT_PLAIN/MARKDOWN/
APPLICATION_PDF/DOCX
content.sourceStringYSource of the knowledge base document.
LOCAL/ONLINE
content.statusStringYStatus of the knowledge base document.
UN_PROCESS/PROCESSING/
PROCESSING_FAILED/PROCESSED
content.totalRecordIntegerYTotal number of records in the knowledge base document.
content.createDatetimeTimestampYCreation time of the knowledge base document.
content.updateDatetimeTimestampYUpdate time of the knowledge base document.

Knowledge Doc Upload

API Request

  • Example
  • Field description
Parameter NameTypeRequiredDescription
knowledgeBaseIdIntegerYUnique identifier for knowledge base.
documentFileYDocument to be uploaded.

API Response

  • Example
  • Field description
Parameter NameTypeRequiredDescription
idStringYTemporary ID of the uploaded document.

Knowledge Doc Extract

Process Trigger

API Request

  • Example
  • Field description
Parameter NameTypeRequiredDescription
idIntegerYTemporary ID of the uploaded document.
knowledgeBaseIdIntegerYUnique identifier for knowledge repository.
sourceStringYSource of the document.
ragStatusStringNWhether to enable Search Enhancement (RAG).
ENABLED/DISABLED
segmentIdentifierStringNSegment identifier.
LINE_BREAK/LINE_BREAK_2
segmentSizeIntegerNSegment size limit (0-2000)

API Response

  • Example
  • Field description
Parameter NameTypeRequiredDescription
taskIdIntegerYID of the task.
statusStringYStatus of the task.
CREATED/IN_PROCESS/FAILED/FINISHED
totalNumIntegerYTotal number of items in the task.
successNumIntegerYNumber of items successfully processed in the task.
failureNumIntegerYNumber of items that failed to be processed in the task.

Process Detail

API Request

  • Example
  • Field description
Parameter NameTypeRequiredDescription
idIntegerYID of the task.

API Response

  • Example
  • Field description
Parameter NameTypeRequiredDescription
taskIdIntegerYID of the task.
statusStringYStatus of the task.
CREATED/IN_PROCESS/FAILED/FINISHED
totalNumIntegerYTotal number of items in the task.
successNumIntegerYNumber of items successfully processed in the task.
failureNumIntegerYNumber of items that failed to be processed in the task.
dataObjectYProgress of the task and additional information.

Knowledge Doc Preview

API Request

  • Example
  • Field description
参数名称类型是否必填描述
pageIntegerN页码(起始值为0)
sizeIntegerN单页返回记录数
knowledgeBaseIdIntegerY知识库唯一标识
knowledgeDocIdIntegerY知识库文档唯一标识

API Response

  • Example
  • Field description
Parameter NameTypeRequiredDescription
idIntegerYUnique identifier of the document.
hasMoreBooleanYIndicates whether there are more segmented contents.
segmentsArray<Object>YList of segmented contents.
segments.numberIntegerYNumber of the document segment (starting from 0).
segments.tokensIntegerYToken estimate for the document segment.
segments.rawStringYRaw data for the document segment.

Knowledge Doc Question-Answering