LogMeIn Rescue API User Guide

getSession_v3

Retrieves the current sessions of any hierarchy node (technician or channel). You can see the list of sessions on the Sessions tab of the Rescue Administration Center.

Changes in Version 3 of getSession

The following fields have been introduced in the getSession_v3 method:
sCustomField3, sCustomField4, and sCustomField5
The content of custom fields 3, 4, and 5.

The following session statuses have been introduced in the getSession_v3 method:

SESSION_UACCESS_​EXPIRED_WASPICKEDUPBEFORE
The unattended access expired and it was picked up by the technician.
SESSION_UACCESS_​EXPIRED_NOTPICKEDUPBEFORE
The unattended access expired without the technician picking it up.
SESSION_UACCESS_​REVOKEDBYCUSTOMER_WASPICKEDUPBEFORE
The customer revoked the unattended access right from the technician who accessed the customer's computer.
SESSION_UACCESS_​REVOKEDBYCUSTOMER_NOTPICKEDUPBEFORE
The customer revoked the unattended access right from the technician who did not access the customer's computer.
SESSION_UACCESS_​REVOKEDBYADMIN_WASPICKEDUPBEFORE
The admin revoked the unattended access right from the technician who accessed the customer's computer.
SESSION_UACCESS_​REVOKEDBYADMIN_NOTPICKEDUPBEFORE
The admin revoked the unattended access right from the technician who did not access the customer's computer.
SESSION_TERMSANDCONDITIONS​DECLINED
The access was declined by the customer by not accepting the terms and conditions.
SESSION_TIMEOUT_​TECHCONNECTIONLOSTOR​SESSIONWASNOTCLOSEDBYTECH
The session timed out or it was closed by the customer.

Input Parameters

Element Description
node The sessions of this node are listed. Required.
noderef 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 ID|Status|Entry ID|Entry|Technician ID|Technician|Start Time|Waiting Time|Custom Field 0|
Custom Field 1|Custom Field 2|Custom Field 3|Custom Field 4|Custom Field 5|Language|
Transferred To|Transferred Comment|Is Lead Technician|HandingOff| 
1663356|Active|0||337366|John Doe|2/16/2012 4:49 PM|104|Customer||||||en|||yes|| 

The list that the getSession_v3 method retrieves contains information about a session in a table. This table has the following columns:

  • ID: Session ID
  • Status: Session status
    Possible values:
    • Aborted: technician was deleted or disabled
    • Active
    • Closed by active customer
    • Closed by customer
    • Closed by technician
    • Closed by waiting customer
    • Connecting
    • Declined by customer
    • Disconnected
    • Expired
    • Not available
    • Offline
    • On Hold
    • Rebooted
    • Rebooting
    • Reconnecting
    • Revoked
    • Timed out
    • Timed out: closed by technician
    • Transferred
    • Transferring
    • Waiting
  • Entry ID: Channel's ID
  • Entry: Channel's name
  • Technician ID: Technician's ID
  • Technician: Technician's name
  • Start Time: Start time of the session
  • Waiting Time: Time elapsed since the last session status change
  • Custom Field 0-5: Custom fields that the Technician fills in when he initiates a session
  • Language: The two-digit language code of the customer's operation system
  • Transferred To: The recipient Technician of a transferred session
  • Transferred Comment: Comment to the recipient Technician when a session transferred
  • Is Lead Technician
  • HandingOff

Return Values

Displayed Return Value Description
ERROR An unspecified error occurred, such as timeout.
OK Retrieving session information succeeded.
NOTLOGGEDIN Retrieving session information failed because the current is no longer logged in.
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 getSession_v3 method that you can call in your environment.

HTTP GET

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

HTTP POST

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

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 = "someEmail@domain.com";
$sPassword = "secretPassword";
$iNodeID = "337366"; //define this with your own data
$eNodeRef = "NODE"; //define this appropriately based on your data
$sAuthCode = "4ahx...80u0";

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

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

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

//switch to XML for easier formatting of output
$output = array(
'eOutput' => "XML"
);

$outputResponse = $soapclient->setOutput($output);
print_r("<b>setOutput Full response.</b> <br />");
print_r($outputResponse);
echo "<br /><br />";					//formatting


//set up array for getSession_v3
$sessionparams = array(
'iNodeID' => $iNodeID,
'eNodeRef' => $eNodeRef,
'sAuthCode' => $sAuthCode
);

//get session(s)
$sessionresult = $soapclient->getSession_v3($sessionparams);

//show the full getSession response
print_r("<b>getSession Text full response.</b><br />");
print_r($sessionresult);

?>

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 Session info
//remember to tag your intended node to the URL
int iNode = "";
string eNodeRef = "NODE";


HttpWebRequest oReqSession = (HttpWebRequest)System.Net.WebRequest.Create(sEndpoint
 + "getSession_v3.aspx?node=" + sNode + "&noderef=" + eNodeRef + "&authcode=" + sAuthCode);
oReqSession.CookieContainer = sessioncookie;

HttpWebResponse oRespSession = (HttpWebResponse)oReqSession.GetResponse();
string sRespSession = new StreamReader(oRespSession.GetResponseStream()).ReadToEnd();
Response.Write("getSession result: " + sRespSession + "<br />");  //You can customize
 the response


%>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Rescue API getSession 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;
                SESSION_V3[] aSessions;

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

                WebServiceClients.getSessionRet oGetSession = proxy.getSession_v3(iNodeID,
 eNodeRef, sAuthCode, out aSessions);
                Response.Write(oGetSession + "<br />");

                foreach(SESSION s in aSessions)
                {
                    Response.Write("Session ID: " + s.iID + " Technician: " + s.sTechnician);
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
    }
}