There is no built-in method of exporting knowledge base (KB) articles through Kayako Classic's user interface. However, you can export knowledge base data using API calls.
This article provides instructions on how to generate the API query syntax to export all KB article data to Kayako Classic.
Before you begin constructing your API query syntax, ensure that the helpdesk API is active.
Note: Use the article about Kayako's REST API as a reference in constructing your query and obtaining the API key and secret key to generate a signature.
Generating a Signature
Use the PHP code snippet below:
<?php $apiKey = "apikey"; $secretKey = "secretkey"; // Generates a random string of ten digits $salt = mt_rand(); // Computes the signature by hashing the salt with the secret key as the key $signature = hash_hmac('sha256', $salt, $secretKey, true); // base64 encode... $encodedSignature = base64_encode($signature); // urlencode... $encodedSignature = urlencode($encodedSignature); echo "Voila! A signature: " . $encodedSignature; ?>
Note: Using PHP is highly recommended. If you are unsure of your code, please run the code first using a PHP emulator like PHPTester.
Go to Admin CP > REST API > API Information and copy your REST API key and secret key information:
Replace the values of the
$secretKeyvariables in the code snippet with the REST API and secret key information you have obtained.
$apiKey = "test1abc-de23-45ef-g6h7-1234567890"; $secretKey = "testqwert123456789asdfghjkl12345789";
Note: Ensure that you paste the key values between the quotation marks.
In this example, we are going to use a static 10-digit number as the value of salt. It is less secure but makes the process straightforward. You can also generate a random string for the value of salt using PHPTester. After determining your 10-digit salt, replace
mt_rand()with the salt code:
$salt = 1234567890;
Copy the code snippet and go to PHPTester. Paste the code on the first field and click the Click to test your PHP code button to generate a signature key:
Constructing the Query Syntax
- Use the generated API signature above to construct the following query syntax based on the REST KnowledgeArticle method and principles:
GET http://<Kayakodomain>/api/index.php?/Knowledgebase/Article&salt=1234567890&apikey=[API Key from Admin Panel]&signature=[Code generated signature]
<Kayako domain>with your Kayako Classic domain.
Replace the API Key and Signature with the information you have gathered from the steps above. Remember to remove the [ ] brackets when pasting the API Key and Signature.
Use Postman, or you may remove
GETfrom the query and copy the URL directly to the browser's address bar to receive the payload output. This process will return all the knowledge base articles' information (including text and data embedded) in XML format.