Desktop client uses lhxml module and all data is exchanged in JSON format. Just missleading module name.
Things to know
1. Desktop client always during request provides username and password.
$_POST['username']
$_POST['password']
Here is list of possible requests url
- http://demo.livehelperchat.com/xml/checklogin it accepts only $_POST['username'],$_POST['password'] as arguments and returns {"result":false} or {"result":true} . This is very first reques which get's executed opn mobile desktop app initial start.
- http://demo.livehelperchat.com/xml/accepttransfer/<transfer_id> accepts transfered chat. returns {"error":false} if everything is ok.
- http://demo.livehelperchat.com/xml/accepttransferbychat/<chat_id> accepts transfered chat also, but this time argument is chat_id
- http://demo.livehelperchat.com/xml/addmsgadmin/<chat_id> to this url also has to be provided $_POST['msg'] returns nothing. Because sync request will fetch next message.
- http://demo.livehelperchat.com/xml/chatdata/<chat_id> returns chat data which JSON looks like
- (array('error' => false, 'canned_messages' => $cannedmsg, 'chat' => $chat, 'ownerstring' => $ownerString) canned_messages is an array and chat is an object.
- array('error' => true,'error_string' => 'You do not have permission to read this chat!') - this string is returned if user does not have permission to open this chat.
- This request is executed upon initial chat window or tab open to get main chat information.
- http://demo.livehelperchat.com/xml/chatssynchro to this url request is executed every 3.5 seconds it chat messages synchronization call.
- $_POST['chats'] = '6|5,1,4;8|0,5,2,0,5,2'; This is example of data which have to be provided. by ";" is separated chat's. By | is separated chat_id and last synchronization messages. Actually not sure so many messages like there should be only one.
- So in this case, we ask messages for two chats 6 and 8 and and all messages from 1 message id 6 chat case, and messages where id >= 0 and chat id is 8. In general our request should look like. $_POST['chats'] = '6|1;8|0';
- Response is
- $arrayReturn[$chat_id]['messages'] = $chatsMessages; // Chat messages array of messages object
- $arrayReturn[$chat_id]['chat_status'] = $chatStatusMessage; // And chat status message.
- http://demo.livehelperchat.com/xml/closechat/<chat_id> - Closes a chat. Returns nothing.
- http://demo.livehelperchat.com/xml/deletechat/<chat_id> - Deletes a chat. Returns nothing.
- http://demo.livehelperchat.com/xml/getuseronlinestatus - Get's currenly logged online user status. Has he checked Offline or Not.
- Returns array('online' => $userData->hide_online == 1) false or true
- http://demo.livehelperchat.com/xml/lists - Returns lists of chats. json_encode(array(
'active_chats' => array('rows' => $activeChats, 'size' => count($activeChats), 'hidden_columns' => $columnsToHide, 'timestamp_delegate' => array('time'),'column_names' => $columnsName),
'online_users' => array('rows' => $onlineUsers, 'size' => count($onlineUsers), 'hidden_columns' => $onlineuserscolumnsToHide,'column_names' => $onlineuserscolumnsNames, 'timestamp_delegate' => array('last_visit','first_visit')),
'closed_chats' => array('rows' => $closedChats, 'size' => count($closedChats), 'hidden_columns' => $columnsToHide, 'timestamp_delegate' => array('time'),'column_names' => $columnsName),
'pending_chats' => array('rows' => $pendingChats, 'size' => count($pendingChats), 'hidden_columns' => $columnsToHide, 'timestamp_delegate' => array('time'),'column_names' => $columnsName),
'transfered_chats' => array('rows' => $transferedChats, 'size' => count($transferedChats), 'hidden_columns' => array_merge($columnsToHide,array('transfer_id')), 'timestamp_delegate' => array('time'),'column_names' => $columnsName),
));
- http://demo.livehelperchat.com/xml/sendnotice/<online_user_id> - send's message to online user. $_POST['msg'] also has to be provided.
- http://demo.livehelperchat.com/xml/setonlinestatus/<status> - set's current user status 0 - offline, 1 - offline this call is used in application to switch from offline to online.
- http://demo.livehelperchat.com/xml/transferchat - get's online operators list. This list is used later to transfer a chat to selected operator
- http://demo.livehelperchat.com/xml/transferuser/<chat_id>/<user_id> - transfers chat to seleceted operator.
- http://demo.livehelperchat.com/xml/userinfo/<online_user_id> array('user' => $tpl->fetch()) return plain text of online user info.
And that's all what you need to know building mobile APP.