LogMeIn Rescue API User Guide


Generates a PIN code and sends it in an invitation SMS to the phone number provided. Sets the custom fields of newly generated Rescue Lens sessions. For information about starting a Rescue Lens session, see How to Start a Rescue Lens Session in the LogMeIn Rescue Lens User Guide, .

Input Parameters

Important: You can request one PIN code per second.
Element Description
cfield0 Custom field 0. The maximum length is 64 characters. Optional.
cfield1 Custom field 1. The maximum length is 512 characters. Optional.
cfield2 Custom field 2. The maximum length is 512 characters. Optional.
cfield3 Custom field 3. The maximum length is 256 characters. Optional.
cfield4 Custom field 4. The maximum length is 64 characters. Optional.
cfield5 Custom field 5. The maximum length is 64 characters. Optional.
tracking0 Tracking field 0. The maximum length is 64 characters. Optional.
notechconsole Specifies if running the Technician Console is required (0) or not (1). Optional, default is 0.
authcode The secret authentication code that is used to authenticate the user without logging in to Rescue. Optional.
PhoneNumber The phone number to which the invitation SMS containing the PIN Code is to be sent. Optional.
LangCode The code of the language in which the invitation SMS is to be sent.

Possible values:

  • de for German
  • en for English
  • es For Spanish
  • fr for French
  • nl for Dutch
  • pt-br for Portuguese (Brazilian)
Optional, default is en.



PINCODE: The 6-digit long PIN code to start a session

Return Values

Displayed Return Value Description
ERROR An unspecified error occurred, such as timeout.
OK Requesting a PIN code succeeded.
NOTLOGGEDIN Requesting a PIN code failed because the current user is no longer logged in.
NOTTECHNICIAN The PIN code was not requested by a technician.
NOTECHCONSOLERUNNING The technician is offline and the Technician Console is not running, but it is possible to request a session for an offline technician.
OUTOFPINCODES There are no more PIN codes that can be generated.
POLLRATEEXCEEDED The specified interval of requesting a new PIN code is too short.
INVALID_SECRETAUTHCODE The authentication code is incorrect.
USER_IS_DELETED The user whose authorization code was specified is already deleted.
USER_DELETED_OR_DISABLED The user whose authorization code was specified is already deleted or disabled.
NO_ACCESS_TO_LENS Requesting a PIN code failed because the current user does not have permission to access Rescue Lens.
INVALID_PHONENUMBER The phone number to which the SMS was to be sent is not valid.
SMS_CANNOT_BE_SENT The SMS cannot be delivered to the recipient.
NO_MORE_SMS The Rescue account has used up all of its allocated SMSs.

Sample Code

The following are examples for using the requestLensPINCode_v3 method that you can call in your environment.




<form method="post" action="https://secure.logmeinrescue.com/API/requestLensPINCodev3.aspx">
       <input name="cfield0" value="custom0">
       <input name="cfield1" value="custom1">
       <input name="cfield2" value="custom2">
       <input name="cfield3" value="custom3">
       <input name="cfield4" value="custom4">
       <input name="cfield5" value="custom5">
       <input name="tracking0" value="track0">
       <input name="notechconsole" value="0">
       <input name="authcode" value="4ahx...80u0">
       <input name="PhoneNumber" value="0">
       <input name="LangCode" value="0">


For sample SOAP 1.1 and SOAP 1.2 request and response messages, visit https://secure.logmeinrescue.com/api/API.asmx?op=requestLensPINCodeV3.


The example values shown must be replaced with actual values.

$soapclient = new SoapClient("https://secure.logmeinrescue.com/api/api.asmx?wsdl");

//define parameters
$loginparams = array (
'sEmail' => 'some@email.com',
'sPassword' => 'secretPassword'

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

//print the result
echo "<b>Login full response.</b><br />";		//formatting
echo "<br /><br />";				//formatting

//get account info
$sCField0 = "some customer";
$sCField1 = "first custom field";
$sCField2 = "second custom field";
$sCField3 = "third custom field";
$sCField4 = "fourth custom field";
$sCField5 = "fifth custom field";
$sTracking0 = $sCField0 . date("c");		//to ensure unique 

//create params array for SOAP request
$requestLensPINCode_v3Params = array(
'sCField0' => $sCField0,
'sCField1' => $sCField1,
'sCField2' => $sCField2,
'sCField3' => $sCField3,
'sCField4' => $sCField4,
'sCField5' => $sCField5,
'sTracking0' => $sTracking0

$requestLensPINCode_v3Result = $soapclient->requestLensPINCode($requestLensPINCode_v3Params);

//print out the PIN Code full response
print_r("<b>requestLensPINCode_v3 full response.</b><br />");
echo "<br /><br />";			//formatting

//show the PIN code only
$PINCode = $requestLensPINCode_v3Result["iPINCode"];

//print PIN Code
print_r("<b>PIN Code.</b><br />");


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" 
     string sEndpoint = "https://secure.logmeinrescue.com/API/";  //add actionName.aspx? for
 each action called
     string sEmail = "some@email.com";
     string sPwd = "secretPassword";

     //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 PINCode info
HttpWebRequest oReqPINCode = (HttpWebRequest)System.Net.WebRequest.Create(sEndpoint
 + "requestLensPINCode_v3.aspx");
oReqPINCode.CookieContainer = sessioncookie;

HttpWebResponse oRespPINCode = (HttpWebResponse)oReqPINCode.GetResponse();
string sRespPINCode = new StreamReader(oRespPINCode.GetResponseStream()).ReadToEnd();
Response.Write("requestLensPINCode_v3 result: " + sRespPINCode + "<br />");  //You can customize
 the response


<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Rescue API requestLensPINCode_v3 Test</title>


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)
                WebServiceClients.API proxy = new WebServiceClients.API();
                proxy.CookieContainer = new CookieContainer();

                string sEmail = "some@email.com";
                string sPwd = "secretPassword";
                string sAuthCode = "";
                string sCField0 = "";
                string sCField1 = "";
                string sCField2 = "";
                string sCField3 = "";
                string sCField4 = "";
                string sCField5 = "";
                string sTracking0 = "";
                int iPIN;

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

                WebServiceClients.requestLensPINCodeRet oRequestLensPINCode = proxy.requestLensPINCode_v3
(sCField0, sCField1, sCField2, sCField3, sCField4, sCField5, sTracking0, true, sAuthCode,
 out iPIN);
                Response.Write(oRequestLensPINCode + "<br />");

                Response.Write("PIN code: " + iPIN);
            catch (Exception ex)