requestAuthCode
Generates an authentication code that prevents the technician from logging out if there is a timeout.
Input Parameters
Element | Description |
---|---|
The email address of the Rescue account. Required. | |
pwd | The password of the corresponding Rescue account. Required. |
Output
OK AUTHCODE: 4ahx99bppkzxocbs590roo1l99o7au9rmwnea8q3areaiceaw1afq55jx89nl5zt63hxlo298qf80u0
AUTHCODE: Secret authentication code
Return Values
Displayed Return Value | Description |
---|---|
ERROR | An unspecified error occurred, such as timeout. |
OK | Generating an authentication code succeeded. |
INVALID | The password and email do not identify and authenticate a technician. |
Sample Code
The following are examples for using the requestAuthCode method that you can call in your environment.
HTTP GET
https://secure.logmeinrescue.com/API/requestAuthCode.aspx?email=some@email.com&pwd=secretPassword
HTTP POST
<form method="post" action="https://secure.logmeinrescue.com/API/requestAuthCode.aspx">
<input name="email" value="some@email.com">
<input name="pwd" value="secretPassword">
</form>
SOAP
For sample SOAP 1.1 and SOAP 1.2 request and response messages, visit https://secure.logmeinrescue.com/api/API.asmx?op=requestAuthCode.
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");
$sEmail = "some@email.com";
$sPwd = "secretPassword";
$requestauthcodeparams = array(
'sEmail' => $sEmail,
'sPassword' => $sPwd
);
$requestAuthCodeResult = $soapclient->requestAuthCode($requestauthcodeparams);
print_r($requestAuthCodeResult);
?>
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";
HttpWebRequest oRequestAuthCode = (HttpWebRequest)WebRequest.Create(sEndpoint
+ "requestAuthCode.aspx?email=" + sEmail + "&pwd=" + sPwd);
HttpWebResponse oRespAuthCode = (HttpWebResponse)oRequestAuthCode
.GetResponse();
string sRespAuthCode = new StreamReader(oRespAuthCode.GetResponseStream())
.ReadToEnd();
Response.Write(sRespAuthCode);
}
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";
string sAuthCode = "";
WebServiceClients.requestAuthCodeRet oRequestAuthCode = proxy.requestAuthCode
(sEmail, sPwd, out sAuthCode);
Response.Write(oRequestAuthCode + "<br />");
Response.Write("authCode: " + sAuthCode);
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
}
}