Legacy Dev Forum Posts

 View Only

Sign Up

KnowledgeService Plugin error

  • 1.  KnowledgeService Plugin error

    Posted 06-05-2025 18:37

    IvanDg | 2023-08-10 02:13:08 UTC | #1

    Hi I am using a headless sdk and global function and I would like to ask what I missed when using KnowledgeService Plugin that it generated an error during execution. I attached the screenshot.

    What I did is the following:

    1. Turn on Knowledge Articles in Message Configuration -> Apps -> Knowledge Articles
    2. Selected a Knowledge base.
    3. Coded the following and execute in my UI.

    export const getSuggestions = (query: string) => { Genesys( 'command', 'KnowledgeService.getSuggestions', { pageSize: 3, query, } ); };


    RanjithManikanteSa | 2023-08-10 18:07:23 UTC | #2

    Hi @IvanDg,

    Thanks for reaching out to us.

    This error can happen if you are trying to call a plugin command before its loaded and initialized. Please subscribe to KnowledgeService.ready event before calling its command, in this way your command is acknowledged by that plugin.

    Genesys('subscribe', 'KnowledgeService.ready', function(){
    		Genesys("command", "KnowledgeService.getSuggestions",
    			{
    				"pageSize": 3,
    				"query": "Genesys"
    			});
    		});

    We will add this as a note in our docs so its clear when reading it.


    IvanDg | 2023-08-14 00:55:16 UTC | #3

    Hi @RanjithManikanteSa Thanks for the response. I will try to execute above from now and get back to you. Thank you!


    IvanDg | 2023-08-14 01:43:38 UTC | #4

    Hello @RanjithManikanteSa

    I tried subscribing to KnowledgeService.ready and it was never invoked. Then I tried Knowledge.ready as well and it was never invoked. Did I miss some other steps?

    Thanks


    system | 2023-09-13 01:44:14 UTC | #5

    This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 21435