Jump to content
Mo6432

Get knowledgebase

Recommended Posts

Hi.

 

I can't seem to find anything about the knowledgebase in the API, is it only possible to retrieve it using a direct connection to the mysql database?

Share this post


Link to post
Share on other sites

Just use what is already available and find a creative way to recycle it.

There is a helpful snippet of code that is used in \templates\six\supportticketsubmit-steptwo.tpl file.

<div id="autoAnswerSuggestions" class="well hidden"></div>

\templates\six\js\whmcs.js and whmcs.js

/**
 * Get automatic knowledgebase suggestions for support ticket message.
 */
var lastTicketMsg;
function getTicketSuggestions() {
    var userMsg = jQuery("#inputMessage").val();
    if (userMsg != lastTicketMsg && userMsg != '') {
        jQuery.post("submitticket.php", { action: "getkbarticles", text: userMsg },
            function (data) {
                if (data) {
                    jQuery("#autoAnswerSuggestions").html(data);
                    if (!jQuery("#autoAnswerSuggestions").is(":visible")) {
                        jQuery("#autoAnswerSuggestions").hide().removeClass('hidden').slideDown();
                    }
                }
            });
        lastTicketMsg = userMsg;
    }
    setTimeout('getTicketSuggestions()', 3000);
}

Happy New year buddy...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines