LiveZilla Live Chat
EN  DE Please sign in or register Hi
Having used hosted chat services before and had nothing but problems, as well as significant costs,...
Simon Mason
Show all reviews


LiveZilla API V2




Operator
Operator Object Format
Operator is represented as JSON objects having the following keys:


JSON Key Type Required Read only Comment Example
UserIdstringYesNoThe alphanumeric login ID of the operators.john_doe
FullnamestringYesNoOperators full name.John Doe
EmailstringYesNoOperators email.john@doe.com
LanguagestringYesNoISO two letter language code.EN
WebspaceintYesNoWebspace in MB operator is allowed to use for file uploads (0=deactivated).100
PasswordstringYesNoOperators password (MD5 encoded).md5('johns_password')
GroupsarrayYesNoList of group IDs representing the groups the operators is a member of.groupid1,groupid2
PermissionSetstringYesNo
String representing the operators permission set.

[0] = TicketPermission
[1] = RatingPermission
[2] = ChatExternalArchivePermission
[3] = ResourcePermission
[4] = EventPermission
[5] = ReportPermission
[6] = MonitoringPermission
[7] = JoinChats
[8] = JoinChatsInvisibly
[9] = TakeChats
[10] = SetChatPriority
[11] = SetChatGroup
[12] = SetChatOperator
[13] = ChatPermission
[14] = SendInvitations
[15] = ClearText
[16] = ForwardChats
[17] = JoinChatsWhenInvited
[18] = DynamicGroupPermission
[19] = CreateFilters
[20] = BotEditPermission
[21] = ChangePicture
[22] = TicketReviewEmails
[23] = TicketCreate
[24] = TicketChangeSignature
[25] = TicketDeleteEmails
[26] = TicketChangeStatus
[27] = TicketChangeStatusOpen
[28] = TicketChangeStatusInProgress
[29] = TicketChangeStatusClosed
[30] = TicketAssignOperator
[31] = TicketAssignGroup
[32] = TicketOvertake
[33] = TicketProcessOpen
[34] = TicketDeleteGlobal
[35] = ProfilePermission
[36] = ChatInternalArchivePermission
[37] = TicketChangeStatusDeleted
[38] = StartChats
[39] = CancelInvitations
[40] = CancelInvitationsOfOthers
[41] = TicketEdit
[42] = CanAutoAcceptChats
[43] = MustAutoAcceptChats
[44] = CanRejectChats
[45] = MobileAccess
[46] = API Access
[47] = KB Entries Read
[48] = KB Entries Write
[49] = Personal Chat Link
[50] = Delete Feedbacks
[51] = View Logs

Example: 2121202101000210111101111111111111011111011011022101
Read more
DescriptionstringNoNoDescription TextNice guy
LevelintNoNoDefines if operator is server administrator.1
StatusintNoYesOperator's current online status (0=Online,1=Busy,2=Offline,3=Away).0
PictureFilestringNoYesOperator's Image File, add to full URL.picture.php?intid...
ChatFilestringNoYesFile to initiate chat with Operator, add to full URL.chat.php?intid...
IsBotbooleanNoYesIs bot (or human).1
ExternalChatsarrayNoYesList of active (external) chat objects. (LiveZilla 5.4.0.1)chat1,chat2
ExternalChatCountintNoYesCount of active (external) chats. (LiveZilla 5.4.0.1)1


Operator Functions


List Operators
Function
As of version 5.2.5.0


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


Filters


Name POST Key Type Required Comment Example  
UserIdp_useridstringNoResponse will be the Operator matching this login Id.john_doe
Statusp_statusintNoReturns all operators having this status.1
Groupp_groupstringNoReturns all operators that are member of this group.groupid1
Full Chatsp_full_chatsboolNoReturn full list of external chat objects (LiveZilla 5.4.0.1).1


CURL Example


curl {yourdomain}{livezilla_folder}/api/v2/api.php
-d {authenthication}
-d p_operators_list=1 -X POST

Response


200 Ok: {
    "Operators": [
        {
            "Operator": {
                "Level": "1",
                "Webspace": 100,
                "Password": "a8c054e6b5e3edf349c1dac58157d1cd",
                "Description": "Nice guy",
                "PermissionSet": "2121202101000210111101111111111111011111011011022101",
                "Groups": [
                    "groupid1",
                    "groupid2"
                ],
                "UserId": "john_doe",
                "Language": "EN",
                "Fullname": "John Doe",
                "Email": "john@doe.com"
            }
        },
        {
            "Operator": {
                "Level": "1",
                "Webspace": 100,
                "Password": "a8c054e6b5e3edf349c1dac58157d1cd",
                "Description": "Nice guy",
                "PermissionSet": "2121202101000210111101111111111111011111011011022101",
                "Groups": [
                    "groupid1",
                    "groupid2"
                ],
                "UserId": "john_doe",
                "Language": "EN",
                "Fullname": "John Doe",
                "Email": "john@doe.com"
            }
        }
    ]
}

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)
                        


Example: PHP code to list all online operators with chat link and image


    <?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_operators_list"]=1;
            $postd["p_json_pretty"]=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);

            if(count($response)==0)
                exit("No operators found");

            foreach($response->Operators as $obj)
            {
                if($obj->Operator->Status < 2 && !$obj->Operator->IsBot)
                {
                    echo "<img src=\"" . $livezillaURL . $obj->Operator->PictureFile . "\"> ";
                    echo $obj->Operator->Fullname . " is online ";
                    echo "<a href=\"" . $livezillaURL . $obj->Operator->ChatFile . "\" >Chat</a><br>";
                }
            }
    ?>



Create Operator
Function
As of version 5.2.5.0


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


Filters


Name POST Key Type Required Comment Example  


CURL Example


curl {yourdomain}{livezilla_folder}/api/v2/api.php
-d {authenthication}
-d p_operator_create=1
-d p_data={ "Operator": { "Level": "1", "Webspace": 100, "Password": "a8c054e6b5e3edf349c1dac58157d1cd", "Description": "Nice guy", "PermissionSet": "2121202101000210111101111111111111011111011011022101", "Groups": [ "groupid1", "groupid2" ], "UserId": "john_doe", "Language": "EN", "Fullname": "John Doe", "Email": "john@doe.com" } } -X POST

Response


200 Ok: {
    "Operator": {
        "Level": "1",
        "Webspace": 100,
        "Password": "a8c054e6b5e3edf349c1dac58157d1cd",
        "Description": "Nice guy",
        "PermissionSet": "2121202101000210111101111111111111011111011011022101",
        "Groups": [
            "groupid1",
            "groupid2"
        ],
        "UserId": "john_doe",
        "Language": "EN",
        "Fullname": "John Doe",
        "Email": "john@doe.com"
    }
}

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)
                        


Example: PHP code to create an operator account


    <?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_operator_create"]=1;
            $postd["p_json_pretty"]=1;

            class Operator
            {
                public $UserId = 'john_doe';
                public $Firstname = 'John';
                public $Lastname = 'Doe';
                public $Email = 'john@doe.com';
                public $Language = 'EN';
                public $Webspace = '100';
                public $Password = "";
                public $Groups = array("support","sales");
                public $PermissionSet = '2121202101000210111101111111111111011111011011022101';
            }

            $newOperator = new Operator();
            $newOperator->Password = md5("johnspassword");

            $postd["p_data"]= json_encode(array("Operator"=>$newOperator));
            $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;
            curl_close($ch);
    ?>



Delete Operator
Function
As of version 5.2.5.0


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


Filters


Name POST Key Type Required Comment Example  


CURL Example


curl {yourdomain}{livezilla_folder}/api/v2/api.php
-d {authenthication}
-d p_operator_delete=1
-d p_userid=john_doe
-d p_data={ "Operator": { "UserId": "john_doe" } } -X POST

Response


200 Ok: {
    "Operator": {
        "Level": "1",
        "Webspace": 100,
        "Password": "a8c054e6b5e3edf349c1dac58157d1cd",
        "Description": "Nice guy",
        "PermissionSet": "2121202101000210111101111111111111011111011011022101",
        "Groups": [
            "groupid1",
            "groupid2"
        ],
        "UserId": "john_doe",
        "Language": "EN",
        "Fullname": "John Doe",
        "Email": "john@doe.com"
    }
}

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)
                        


Example: PHP code to delete an operator account


    <?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_operator_delete"]=1;
            $postd["p_json_pretty"]=1;

            class Operator
            {
                public $UserId = 'john_doe';
            }

            $deleteOperator = new Operator();
            $postd["p_data"]= json_encode(array("Operator"=>$deleteOperator));
            $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;
            curl_close($ch);
    ?>





Something missing?


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