logIn
This method authenticates and logs in the user. It reproduces the login process to your LogMeIn Rescue account.
Note: For information about the different authentication methods, see
Options for Authenticating with Rescue API.
Input Parameters
Element | Description |
---|---|
The email address of the Rescue account that you want to log in. Required. | |
pwd | The password of the corresponding Rescue account. Required. |
Return Values
Displayed Return Value | Description |
---|---|
ERROR | An unspecified error occurred. |
OK | The user successfully logged in. |
INVALID | Login failed because at least one of the input values is incorrect. |
LIMITREACHED | The
logIn method was called more than ten times
in three minutes.
Note: If you want to log in more often, use the
requestAuthCode
API method. Once you are logged in, the authcode prevents you from logging out
if there is a timeout.
|
Sample Code
The following are examples for using the logIn method that you can call in your environment.
HTTP GET
https://secure.logmeinrescue.com/API/login.aspx?email=some@email.com&pwd=secretPassword
HTTP POST
<form method="post" action="https://secure.logmeinrescue.com/API/login.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=login.
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
?>
C# with HttpWebRequest
The example values shown must be replaced with actual values.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
string sEndpoint = "https://secure.logmeinrescue.com/API/login.aspx";
string sEmail = "some@email.com";
string sPwd = "secretPassword";
System.Net.HttpWebRequest oReq =
(System.Net.HttpWebRequest)System.Net.WebRequest.Create(sEndpoint + "?email="
+ sEmail + "&pwd=" + sPwd);
System.Net.HttpWebResponse oResp = (System.Net.HttpWebResponse)oReq.GetResponse();
string sResp = new System.IO.StreamReader(oResp.GetResponseStream()).ReadToEnd();
Response.Write(sResp); //You can customize the response
%>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Rescue API Login Test</title>
</head>
<body>
</body>
</html>
C# with SOAP
The example values shown must be replaced with actual values.
<%@ Page Language="C#" %>
<%@ Import Namespace="System"%>
<%@ Import Namespace="System.Net"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Rescue API Login Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<%
//create a proxy for the SOAP requests
WebServiceClients.API proxy = new WebServiceClients.API();
//set up variables
string sEmail = "some@email.com";
string sPwd = "secretPassword";
//Initiate an API login
WebServiceClients.loginRet loginResult = proxy.login(sEmail,sPwd);
Response.Write(loginResult);
%>µ
</div>
</form>
</body>
</html>