LogMeIn Rescue API User Guide

requestLensPINCode_v4

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 including the ID of the technician (NodeID) for whom the PIN code has been generated. 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.
NodeId The ID (NodeID) of the technician for whom the PIN code has been generated.
Note: This applies to Administrators with a technician license, too.

Output

OK PINCODE:123456
SMS_RESULT: sendInvitationForMobileSession_OK

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_v4 method that you can call in your environment.

SOAP

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

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 parameters
$loginparams = array (
'sEmail' => 'some@email.com',
'sPassword' => 'secretPassword'
);

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

//print the result
echo "<b>Login full response.</b><br />";		//formatting
print_r($loginResult);
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_v4Params = array(
'sCField0' => $sCField0,
'sCField1' => $sCField1,
'sCField2' => $sCField2,
'sCField3' => $sCField3,
'sCField4' => $sCField4,
'sCField5' => $sCField5,
'sTracking0' => $sTracking0
);

$requestLensPINCode_v4Result = $soapclient->requestLensPINCode($requestLensPINCode_v4Params);

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

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

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

?>

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 = "";
                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_v4
(sCField0, sCField1, sCField2, sCField3, sCField4, sCField5, sTracking0, true, sAuthCode,
 out iPIN);
                Response.Write(oRequestLensPINCode + "<br />");

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