LiveZilla Live Chat
EN  DE Please sign in or register Hi
Its great. I have used both on my private site and at work. Really enjoy having it and the concept of...
Arthur K
Show all reviews


LiveZilla API V2






Cronjob Functions


Execute Cronjob
Function
As of version 7.0.0.3


POST /api/v2/api.php p_cronjob_execute=1


Filters


Name POST Key Type Required Comment Example  
Send Chat Transcriptsp_send_chat_transcriptsboolYesClosed chats will be archived and chat transcripts will be sent. Call every 10-20 hours.1
Receive Emailsp_receive_emailsboolYesEmails will be downloaded from mailboxes. Call every 2-5 minutes.1
Maintenancep_maintenanceboolYesPruning and optimizing databases. Call every 10-120 seconds.1
Social Mediap_social_mediaboolYesDownload messages from Social Media. Call every 10-120 seconds.1


CURL Example


curl {yourdomain}{livezilla_folder}/api/v2/api.php
-d {authenthication}
-d p_cronjob_execute=1
-d p_cronjob_maintain=1
-d p_send_chat_transcripts=1
-d p_receive_emails=1
-d p_social_media=1 -X POST

Response


200 Ok: "SUCCESS"

Error Codes


                            403 Forbidden: Invalid or no user authentication data sent (see General API Authentication)
400 Bad Data: Invalid or missing POST parameters (see required fields/filters and data types)
                        


PHP code to execute CronJobs


    <?php
            $livezillaURL = "http(s)://{yourdomain}/livezilla/";
            $apiURL = $livezillaURL . "api/v2/api.php";

            // authentication parameters
            $postd["p_user"]='{user_id}';
            $postd["p_pass"]=md5('{user_password}');

            // function parameter
            $postd["p_cronjob_execute"]=1;
            $postd["p_send_chat_transcripts"]=1;
            $postd["p_receive_emails"]=1;
            $postd["p_maintenance"]=1;
            $postd["p_social_media"]=1;

            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL,$apiURL);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($postd));
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            $server_output = curl_exec($ch);

            if($server_output === false)
                exit(curl_error($ch));

            echo $server_output;
            echo "<hr>";
            curl_close($ch);

            $response = json_decode($server_output);
    ?>





Something missing?


If you find anything missing please let us know and we will add the missing structures right away. Thanks.