LogMeIn Rescue API User Guide

getChat

Retrieves the chat log of any specific session of the user who is currently logged in. You can retrieve chat logs by selecting the Chatlog report area in the Reports tab of the Rescue Administration Center. For information on reports, see Generating Reports in the LogMeIn Rescue Administration Center User Guide.

Note: Since this API method is session-based, changing the date, time, or format of the generated reports does not effect the output. For example, even if you set the reporting time between 10 am and 4 pm, this API method will return the complete chat log of a session that started outside the specified time span.

Input Parameters

Element Description
session The chat log of the specified session will be generated. Required.
authcode The secret authentication code that is used to authenticate the user without logging in to Rescue. Optional.

Output

OK CHATLOG:10:09 AM Connecting to: control.dev-app01.3amlabs.net (192.168.2.180:443) 
10:09 AM Connected to Applet (RSA 2048 bits, AES256-SHA 256 bits) 10:09 AM Switched to P2P 
10:09 AM Technician: Hello, how can I help you? 10:09 AM Customer Chris: I have problems 
connecting an external drive. 10:09 AM Technician: Let me see what I can do for you. 
10:10 AM Requesting Dashboard information. 10:10 AM Waiting for customer permission to view 
system information. 10:10 AM Dashboard Memory information received. 10:10 AM Dashboard Drives 
information received. 10:10 AM Dashboard OS information received. 10:10 AM Dashboard Scheduled 
Tasks information received. 10:10 AM Dashboard Events information received. 10:10 AM Dashboard 
CPU information received. 10:10 AM Dashboard Processes information received. 10:10 AM Remote 
Control successfully initiated. 10:12 AM Technician: OK, you are all set. 10:12 AM The 
technician ended the session.
Chatlog: The complete chat log of a session.

Return Values

Displayed Return Value Description
ERROR An unspecified error occurred, such as timeout.
OK Retrieving the chat log succeeded.
NOTLOGGEDIN Retrieving the chat log failed because the current user is no longer logged in.
INVALIDPARAM_SESSION The specified session ID is invalid.
INVALID_SECRETAUTHCODE The secret authentication code for the user is invalid.
USER_DELETED_OR_DISABLED The user is deleted or disabled.

Sample Code

The following are examples for using the getChat method that you can call in your environment.

HTTP GET

https://secure.logmeinrescue.com/API/getChat.aspx?session=12345678
&authcode=4ahx...80u0

HTTP POST

<form method="post" action="https://secure.logmeinrescue.com/API/getChat.aspx">
        <input name="session" value="12345678">
        <input name="authcode" value="4ahx...80u0">
</form>

SOAP

For sample SOAP 1.1 and SOAP 1.2 request and response messages, visit https://secure.logmeinrescue.com/api/API.asmx?op=getChat.

PHP with SOAP

The example values shown must be replaced with actual values.

php
$soapclient = new SoapClient("https://secure.logmeinrescue.com/api/api.asmx?wsdl");

//define parameters
$loginparams = array (
'sEmail' => 'some@email.com',
'sPassword' => 'secretPassword'
);

//login
$loginResult = $soapclient->login($loginparams);

//print the result
echo "<b>Login full response.</b><br />";		//formatting
print_r($loginResult);
echo "<br /><br />";					//formatting

//set up array for getChat request
$iSessionID = "12345678";				//populate this dynamically
$sAuthCode = "4ahx...80u0";

$getChatParams = array(
'iSessionID' => $iSessionID,
'sAuthCode' => $sAuthCode
);

$getChatResult = $soapclient->getChat($getChatParams);

//print out the chat full response
print_r("<b>getChat full response.</b><br />");
print_r($getChatResult);
echo "<br /><br />";					//formatting

?>

C# with HttpWebRequest

The example values shown must be replaced with actual values.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <% 
     string sEndpoint = "https://secure.logmeinrescue.com/API/";  //add actionName.aspx?
 for each action called
     string sEmail = "some@email.com";
     string sPwd = "secretPassword";
     string sAuthCode = "4ahx...80u0";

     //set up the request
     HttpWebRequest oReq = (HttpWebRequest)System.Net.WebRequest.Create(sEndpoint
 + "login.aspx" + "?email=" + sEmail + "&pwd=" + sPwd);
    
     //create a cookie container to store the cookies for this session 
     oReq.CookieContainer = new CookieContainer();
     
     
     //get the response
     HttpWebResponse oResp = (HttpWebResponse)oReq.GetResponse();

string sResp = new StreamReader(oResp.GetResponseStream()).ReadToEnd();
Response.Write("Login result: " + sResp + "<br />");  //You can customize the response

/*
//debug cookies
foreach (Cookie cook in oResp.Cookies)
{
Response.Write("Cookie:" + "<br />");
Response.Write("Name: " + cook.Name + " " + "Value: " + cook.Value + "<br />");
Response.Write("Domain: " + cook.Domain + "<br />");
Response.Write("Path: " + cook.Path + "<br />");
Response.Write("Port: " + cook.Port + "<br />");
Response.Write("Secure: " + cook.Secure + "<br />");

Response.Write("When issued: " + cook.TimeStamp + "<br />");
Response.Write("Expires: " + cook.Expires + " " + "Expired? " + cook.Expired + "<br />");
Response.Write("Don't save: " + cook.Discard + "<br />");
Response.Write("Comment: " + cook.Comment + "<br />");
Response.Write("Uri for comments: " + cook.CommentUri + "<br />");
Response.Write("Version: RFC " + cook.Version + "<br />");
    
// Show the string representation of the cookie.
Response.Write("String: " + cook.ToString());
}*/
     
//add cookies to cookie container
CookieContainer sessioncookie = oReq.CookieContainer;

//get the Chat info
string sSession = "12345678";  //populate this sessionID dynamically
HttpWebRequest oReqChat = (HttpWebRequest)System.Net.WebRequest.Create(sEndpoint
 + "getChat.aspx?session=" + sSession + "&authcode=" + sAuthCode);
oReqChat.CookieContainer = sessioncookie;

HttpWebResponse oRespChat = (HttpWebResponse)oReqChat.GetResponse();
string sRespChat = new StreamReader(oRespChat.GetResponseStream()).ReadToEnd();
Response.Write("getChat result: " + sRespChat + "<br />");  //You can customize the
 response

%>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Rescue API getChat Test</title>
</head>
<body>

</body>
</html>

C# with SOAP

The example values shown must be replaced with actual values.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using apiSamples.WebServiceClients;

namespace apiSamples
{
    public partial class SOAP : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                WebServiceClients.API proxy = new WebServiceClients.API();
                proxy.CookieContainer = new CookieContainer();

                string sEmail = "some@email.com";
                string sPwd = "secretPassword";
                int iSession = 12345678;
                string sAuthCode = "4ahx...80u0";
                string sChatLog = "";

                WebServiceClients.loginRet oLogin = proxy.login(sEmail, sPwd);
                Response.Write(oLogin + "<br />");

                WebServiceClients.getChatRet oGetChat = proxy.getChat(iSession,
 sAuthCode, out sChatLog);
                Response.Write(oGetChat + "<br />");

                Response.Write(sChatLog + "<br />");
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
    }
}