Start a conversation

Running Custom Reports on Schedule

Overview

Although we do not have a ready custom report scheduling functionality in Kayako itself, we have a relatively easy workaround you can run on your own system. 

In this article, we will go over the process of creating schedules for custom reports to be executed on a periodical basis. This process requires that a scheduled task is configured on a server or a computer with a stable connection to your Kayako instance, and it varies depending on the Operating System of that computer.

 

Diagnosis

You can create custom reports from the Insights section that gives you direct access to all of your conversation and customer data and makes it available for quick export into a CSV spreadsheet.

Once the report is created,  you can always go back to the Insights section of your agent area to extract these reports manually at any time.

We do not have a feature within Kayako that will allow you to run and extract these reports on a specific schedule. But you can schedule a task on a server or a computer with a stable connection to your Kayako instance to run these reports automatically.

 

Prerequisite

  • Working knowledge of CURL.
  • Skills and knowledge of API (Application Programming Interface) calls.
  • Pre-built custom reports in your Kayako agent area > Insights > Custom reports section.

 

Solution

Configuring scheduled custom report on a Windows machine:

  1. Download CURL. CURL is a way of scheduling the HTTP request directly via command prompt or terminal:
    • Download CURL.exe file for Windows-based systems (after extracting the .zip file, copy the CURL.exe file from the src directory to a directory of your choice. For exemplary purposes, we will use 'c:\kayakoreport\').
    • If the above link does not work, please download the appropriate one here for your system.
  2. Open a text editor (for example, Notepad) and enter the following text lines:
    cd c:\kayakoreport\
    echo script started >> c:\kayakoreport\log.txt
    CURL -X POST https://yourdomain.kayako.com/api/v1/reports/4/generate -u agent@domain.com:password >> c:\kayakoreport\curloutput.txt
    echo script ended >> c:\kayakoreport\log.txt
    where:
    • c:\kayakoreport\ is the directory where you placed the CURL.exe file.
    • yourdomain.kayako.com/api/v1/reports/ is your Kayako instance API URL
      • NOTE: Replace "yourdomain" with your actual Kayako domain name.
    • 4 is your report ID.
      • NOTE: To get the report ID, you can run this GET API URL https://yourdomain.kayako.com/api/v1/reports on the same browser while logged in to Kayako.
    • generate is the API method call.
    • -u agent@domain.com:password is the email and password of the account that created the report.
    • c:\kayakoreport\curloutput.txt is the file path with the output of the command.
  3. Save the file with the .bat extension in your CURL directory.
  4. Create a Scheduled task using Windows Task Scheduler:
    1. Navigate to Start > Control Panel > System and Maintenance > Administrative Tools.
    2. Double-click Task Scheduler.
    3. Browse the task folder in the console tree that you want to create the task in or create a new folder.
    4. In the Actions Pane, click Create Basic Task.
    5. Follow the instructions in the Create Basic Task Wizard to run the .bat file you created earlier on defined schedule or time.

Configuring scheduled custom report on an OS X or Linux machine:

  1. Open a Terminal window.
  2. Execute the following command: crontab -e
    1. Press the i key on your keyboard to enter INSERT mode (This action enables editing via the vi editor which is used by crontab).
    2. Enter the following command:
      0 18 * * * curl -X POST "https://yourhelpdesk.kayako.com/api/v1/reports/4/generate"
                  -u admin@domain.com:Password >> Downloads/curloutput.txt
      Below is an explanation of each parameter (these need to be modified accordingly):
      • 0 is the minute mark when the task will be scheduled.
      • 18 is the hour mark when the task will be scheduled.
      • * * * defines daily recurrence.
      • The rest of the parameters of the command are explained above.
    3. Press Esc.
    4. Enter the command: :wq and press Enter.

Confirmation

The reports will be executed at the specified time and will be available on the portal after roughly 5-10 minutes.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. ATLAS

  2. Posted

Comments