LogMeIn Rescue API User Guide

getReport

Retrieves the report based on previously defined parameters. The output of the report depends on the parameters defined with the setReportArea, setDelimiter, setOutput, setReportDate, setReportTime, and setTimeZone methods. You can retrieve a report in the Rescue Administration Center from the Reports tab. For information on reports, see Generating Reports in the LogMeIn Rescue Administration Center User Guide.

Input Parameters

Important: You can retrieve reports every 60 seconds.
Element Description
node The report is generated based on this node. Required.
nodetype The reference of the node, which can be NODE or CHANNEL. Optional, default is NODE.
authcode The secret authentication code that is used to authenticate the user without logging in to Rescue. Optional.

Output

OK Start Time|End Time|Last Action Time|Technician Name|Technician ID|
Session ID|Session Type|Status|Name|Custom field 1|Custom field 2|Custom field 3|
Custom field 4|Custom field 5|Tracking ID|Customer IP|Device ID|Incident Tools Used|
Resolved Unresolved|Channel ID|Channel Name|Calling Card|Connecting Time|Waiting Time|
Total Time|Active Time|Work Time|Hold Time|Time in Transfer|Rebooting Time|
Reconnecting Time|Platform| 16/7/2012 8:17:23 AM|16/7/2012 8:18:07 AM|16/7/2012 
8:18:06 AM|Justin Case|1028224|1595374|Applet|Closed by technician|sadcac||||||
|192.168.5.74|7945e345a43a29b5074df0ba189f9cb8|RV PS SP|||||00:00:06|00:00:01
|00:00:44|00:00:44|00:00:38|00:00:00|00:00:00|00:00:00|00:00:00|Windows 7|

The session report has the following header columns:

  • Start Time
  • End Time
  • Technician Name
  • Technician ID
  • Session ID
  • Session Type
  • Status
  • [Defined name for the name field]
  • [Defined name for the custom field 1]
  • [Defined name for the custom field 2]
  • [Defined name for the custom field 3]
  • [Defined name for the custom field 4]
  • [Defined name for the custom field 5]
  • Tracking ID
  • Customer IP
  • Computer ID
  • Incident Tools Used ID
  • Resolved
  • Unresolved
  • Channel ID
  • Channel Name
  • Calling Card
  • Connecting Time
  • Waiting Time
  • Total Time
  • Active Time
  • Work Time
  • Hold Time
  • Transfer Time
  • Rebooting Time
  • Reconnecting Time
  • Platform
  • Technician Email
  • Browser Type

Return Values

Displayed Return Value Description
ERROR An unspecified error occurred, such as timeout.
OK Retrieving a report succeeded.
NOTLOGGEDIN Retrieving a report failed because the current user is no longer logged in.
POLLRATEEXCEEDED This error is displayed when you call the getReport method more than 10 times in three minutes.

Should you need to retrieve reports more often, you must use the authcode implementation.

INVALIDPARAM_NODE The specified ID is not the ID of an existing node.
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 getReport method that you can call in your environment.

HTTP GET

https://secure.logmeinrescue.com/API/getReport.aspx?node=337366
&nodetype=NODE&authcode=4ahx...80u0

HTTP POST

<form method="post" action="https://secure.logmeinrescue.com/API/getReport.aspx">
        <input name="node" value="337366">
        <input name="nodetype" value="NODE">
        <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=getReport.

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 variables
$sEmail = "some@email.com";
$sPassword = "secretPassword";
$sBeginDate = "05/09/2007";		//define this with your own data
$sEndDate = "07/01/2007";	//define this appropriately based on your data
$eReportArea = "SESSION";
$iNodeID = "337366";
$eNodeRef = "NODE";
$sAuthCode = "";

//define parameters
$loginparams = array (
'sEmail' => $sEmail,
'sPassword' => $sPassword);

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

/*******uncomment for debug
//print the result
echo "<b>Login full response.</b><br />";		//formatting
print_r($loginResult);
echo "<br /><br />";					//formatting
*******/
//set the report area
//define parameters
$reportareaarams = array (
'eReportArea' => $eReportArea,
'sAuthCode' => $sAuthCode
);

$setReportAreaResponse = $soapclient->setReportArea($reportareaparams);

/*******uncomment for debug
print_r("<b>setReportArea Full response.</b> <br />");
print_r($setReportAreaResponse);
echo "<br /><br />";					//formatting
*******/

//set the time frame
$reportDateParams= array(
'sBeginDate' => $sBeginDate,
'sEndDate' => $sEndDate,
'sAuthCode' => $sAuthCode
);

$setReportDateResponse = $soapclient->setReportDate($reportDateParams);

/******** uncomment for debug
print_r("<b>setReportDate Full response.</b> <br />");
print_r($setReportDateResponse);
echo "<br /><br />";					//formatting
********/

//finally, get the report
//set up array
$getReportParams = array(
'iNodeID' => $iNodeID,
'eNodeRef' => $eNodeRef,
'sAuthCode' => $sAuthCode
);

$getReportResponse = $soapclient->getReport($getReportParams);

/******** uncomment for debug
print_r("<b>getReport Full response (need to parse.).</b> <br />");
print_r($getReportResponse);
echo "<br /><br />";					//formatting
********/

//parse results into an array (NuSOAP stinks at multilevel XML
$reportdata = explode("\n",$getReportResponse['sReport']);
foreach($reportdata as $key => $val) {
    if($key == 0) {
    $COLUMN = explode ("|",$val);
}
$COLDATA = explode("|",$val);
foreach($COLDATA as $ckey => $val) { 
    if(empty($COLUMN[$ckey])) {
    $COLUMN[$ckey] = $ckey;
} else {
    $COLUMN[$ckey] = str_replace( " ","",$COLUMN[$ckey]);
}
  $REPORT[$key][$COLUMN[$ckey]] = $val;
 }
}

/******uncomment for debug
//print array to browser
print_r("<b>results parsed into an array.</b><br />");
print_r($REPORT);
print_r("<br /><br />");
******/

$reportdata = $REPORT;
//get just the report data, and number off nodes in it
$reportentries = count($REPORT);
print_r("<b>Number of report lines:" .  $reportentries . "</b><br /><br />");


//format report nicely
print_r("<b>formatted report.</b><br />");
print_r("<table frame = \"border\" border = \"0\">");
for ($i = 0; $i < $reportentries; $i += 1)
{
	print_r("<tr>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["SessionID"] . "</td>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["StartTime"] . "</td>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["EndTime"] . "</td>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["TechnicianID"] . "</td>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["CustomerIP"] . "</td>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["ComputerID"] . "</td>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["Status"] . "</td>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["Name"] . "</td");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["PhoneNumber"] . "</td>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["EmailAddress"] . "</td>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["Product"] . "</td>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["OrderID"] . "</td>");
	print_r("<td style=white-space: nowrap>" 
. $reportdata[$i]["ChannelID"] . "</td>");
	print_r("</tr>");
}
print_r("</table");

?>

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";
     NODE_REF eNodeRef = NODE_REF.NODE;

     //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 Report info
//remember to tag your intended node to the URL
string sNode = "";
HttpWebRequest oReqReport = (HttpWebRequest)System.Net.WebRequest.Create(sEndpoint
 + "getReport.aspx?node=" + sNode + "&noderef=" + eNodeRef + "&authcode=" + sAuthCode;);
oReqReport.CookieContainer = sessioncookie;

HttpWebResponse oRespReport = (HttpWebResponse)oReqReport.GetResponse();
string sRespReport = new StreamReader(oRespReport.GetResponseStream()).ReadToEnd();
Response.Write("getReport result: " + sRespReport + "<br />");  //You can customize the
 response

%>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Rescue API getReport 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";
                string sAuthCode = "4ahx...80u0";
                int iNodeID = 337366;
                NODE_REF eNodeRef = NODE_REF.NODE;
                string sReport = "";
                DateTime dBeginDate = new DateTime(2010, 7, 1);
                DateTime dEndDate = new DateTime(2010, 7, 8);

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

                WebServiceClients.setReportAreaRet oSetReportArea = proxy.setReportArea
(REPORT.LOGIN, sAuthCode);
                Response.Write(oSetReportArea + "<br />");

                WebServiceClients.setReportDateRet oSetReportDate = proxy.setReportDate_v2
(dBeginDate, dEndDate, sAuthCode);

                WebServiceClients.getReportRet oGetReport = proxy.getReport(iNodeID,
 eNodeRef, sAuthCode, out sReport);
                Response.Write(oGetReport + "<br />");

                Response.Write(sReport);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
    }
}