LogMeIn Rescue API User Guide

startSession

An administrator can start a session of a technician. You can start a session from the Sessions tab of the Rescue Administration Center.

Input Parameters

Element Description
session The ID of the target session. Required.
node The session is picked up by this node. Required.
authcode The secret authentication code that is used to authenticate the user without logging in to Rescue. Optional.

Return Values

Displayed Return Value Description
ERROR An unspecified error occurred, such as timeout.
OK Starting a session succeeded.
NOTLOGGEDINASADMIN Starting a session failed because the administrator is not logged in.
ACTIONFAILED Starting a session failed because the technician is offline and the Technician Console is not running.
INVALIDPARAM_SESSION The ID of the session is incorrect.
INVALIDPARAM_NODE The ID of the user who starts the session is incorrect.
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 startSession method that you can call in your environment.

HTTP GET

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

HTTP POST

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

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");

	$loginparams = array (
		'sEmail' => 'some@email.com',
		'sPassword' => 'secretpassword'
	);

	$iSessionID = 12345678;
	$iNodeID = 337366;
	$sAuthCode = "4ahx...80u0";
	
	$startsessionparams = array (
		'iSessionID' => $iSessionID,
		'iNodeID' => $iNodeID,
		'sAuthCode' => $sAuthCode
	);

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

	$startSessionResult = $soapclient->startSession($startsessionparams);
	
	print_r($startSessionResult);
?>

C# with HttpWebRequest

The example values shown must be replaced with actual values.

using System;
using System.Collections.Generic;
using System.IO;
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 _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string sEndpoint = "https://secure.logmeinrescue.com/api/";
                string sEmail = "some@email.com";
                string sPwd = "secretpassword";
                int iSession = 12345678;
                int iNodeID = 337366;
                string sAuthCode = "4ahx...80u0";

                HttpWebRequest oLogin = (HttpWebRequest)WebRequest.Create(sEndpoint
 + "login.aspx?email=" + sEmail + "&pwd=" + sPwd);
                oLogin.CookieContainer = new CookieContainer();
                HttpWebResponse oRespLogin = (HttpWebResponse)oLogin.GetResponse();

                string sRespLogin = new StreamReader(oRespLogin.GetResponseStream())
.ReadToEnd();
                Response.Write(sRespLogin + "<br />");

                CookieContainer sessioncookie = oLogin.CookieContainer;

                HttpWebRequest oReqStartSession = (HttpWebRequest)WebRequest.Create(sEndpoint
 + "startSession.aspx?session=" + iSession + "&node=" + iNodeID + "&authcode=" + sAuthCode);
                HttpWebResponse oRespStartSession = (HttpWebResponse)
oReqStartSession.GetResponse();

                string sRespStartSession = new StreamReader
(oRespStartSession.GetResponseStream()).ReadToEnd();
                Response.Write(sRespStartSession);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
    }
}

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;
                int iNodeID = 337366;
                string sAuthCode = "4ahx...80u0";

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

                WebServiceClients.startSessionRet oStartSession = proxy.startSession
(iSession, iNodeID, sAuthCode);
                Response.Write(oStartSession);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
    }
}