LogMeIn Rescue API User Guide

cancelAction

An administrator can cancel the action that he performed on a technician session. You can cancel an action from the Sessions tab of the Rescue Administration Center.

Input Parameters

Element Description
session The ID of the target session. 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 Cancelling the action succeeded.
NOTLOGGEDINASADMIN Cancelling the action failed because the administrator is not logged in.
ACTIONFAILED Cancelling the action failed because the technician is offline and the Technician Console is not running.
INVALIDPARAM_SESSION The ID of the session on which you want to cancel an action 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 cancelAction method that you can call in your environment.

HTTP GET

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

HTTP POST

<form method="post" action="https://secure.logmeinrescue.com/API/cancelAction.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=cancelAction.

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

	$cancelactionparams = array (
		'iSession' => 12345678,
		'sAuthCode' => '4ahx...80u0'
	);

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

	print_r($loginResult);

	$cancelActionResult = $soapclient->cancelAction($cancelactionparams);

	print_r($cancelActionResult);
?>

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;

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";
                //ID of the session
                int iSession = 12345678;
                //sAuthCode is the return value from the requestAuthCode API
                string sAuthCode = "4ahx...80u0";

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

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

                CookieContainer sessioncookie = oReqLogin.CookieContainer;

                HttpWebRequest oReqCancelAction = (HttpWebRequest)WebRequest.Create(sEndpoint
 + "cancelAction.aspx?session=" + iSession + "&authcode=" + sAuthCode);
                oReqCancelAction.CookieContainer = sessioncookie;

                HttpWebResponse oRespCancelAction = (HttpWebResponse)oReqCancelAction
.GetResponse();
                string sRespCancelAction = new StreamReader(oRespCancelAction.
GetResponseStream()).ReadToEnd();
                Response.Write(sRespCancelAction + "<br />");
            }
            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;
                string sAuthCode = "4ahx...80u0";

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

                WebServiceClients.cancelActionRet oCancelAction = proxy.cancelAction
(iSession, sAuthCode);
                Response.Write(oCancelAction + "<br />");
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
    }
}