From Bright Pattern Documentation
< 5.19:AgentDesktop-client-side-javascript-api-specification
Revision as of 04:01, 29 May 2024 by BpDeeplTranslateMaintenance (talk | contribs) (Updated via BpDeleteTranslateTags script)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
• 5.19


onSearchKnowledgeBase

This is the handler to perform an external Knowledge Base search from the Agent Desktop Communicator Widget; returned results will be displayed as a search result list. Note: If you set multiple handlers that all return some data, only the result from the last handler will be used.

Request

Syntax

on('ON_SEARCH_KNOWLEDGE_BASE', handler: OnSearchKnowledgeBaseHandler): void


type OnSearchKnowledgeBaseHandler = (query: string) => ExternalKBSearchResult[] | Promise<ExternalKBSearchResult[]>


type ExternalKBSearchResult = {

    id: string

    text: string

}

Parameters

Parameter Parameter Values Data Type Optional/Required Description
query String Required The desired search query for the external Knowledge Base

Example Request

Microsoft Dynamics 365 has its own Knowledge Base (KB) with KB articles. The callback onSearchKnowledgeBase allows your contact center to perform a search in the Microsoft Dynamics 365 Knowledge Base from our Agent Desktop application..

jsApi.on("ON_SEARCH_KNOWLEDGE_BASE", function (query) {

    // Search external KB by query from your contact center

    const results = searchExternalKBArticles(query);

    // Return search results back to your contact center

    return results;

});

Return Value

Object Object Values Data Type Optional? (Y/N) Value Description
ExternalKBSearchResult
id String N The unique ID of the article that will be requested by the handler onGetKnowledgeBaseArticle
text String N A text preview of the article’s content
< Previous | Next >