LogMeIn Rescue API User Guide

getReport_v2

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.

Changes in Version 2 of getReport

The following values have been introduced to the nodetype input parameter in the getReport_v2 method:
EXTERNALROOT
A report will be generated on the External Technicians organizational category that contains all external collaborators.
EXTERNALTECH
A report will be generated on a specific external technician.
EXTERNALGROUP
A report will be generated on a group of external technicians.

Input Parameters

Important: You can retrieve reports every 60 seconds.
Element Description
node The report is generated based on this node ID. Required.
nodetype The reference of the node. Optional, default is NODE.

The following node types are available:

  • NODE - Use when the node is a Technician
  • CHANNEL - Use when the node is a channel
  • EXTERNALROOT - Use when the node is the root element of external technicians. In the Administration Center, this is the External Technicians label on the organization tree.
  • EXTERNALTECH - Use when the node is an external technician
  • EXTERNALGROUP - Use when the node is an external technician group
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
  • Last Action Time
  • Technician Name
  • Technician ID
  • Session ID
  • Session Type
  • Status
  • [Defined name for the name field]
  • [Defined name for the custom field 1..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

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 The specified interval of requesting a report is too short.
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_v2 method that you can call in your environment.

HTTP GET

https://secure.logmeinrescue.com/API/getReport_v2.aspx?node=-2&nodetype=EXTERNALROOT
&authcode=4ahx...80u0

HTTP POST

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

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.EXTERNALTECH;

     //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_v2.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_v2 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_v2 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.EXTERNALTECH;
                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_v2 = proxy.getReport_v2(iNodeID,
 eNodeRef, sAuthCode, out sReport);
                Response.Write(oGetReport_v2 + "<br />");

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