setUserStatus_v7_1
This method changes the status of a Rescue user, whether it is a Technician, Administrator, or Master Administrator.
Input Parameters
Element | Description |
---|---|
node | The ID of the Rescue user whose status you want to change. Required. |
status | The desired status of the Rescue user.
Required.
The possible values are as follows:
|
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. |
OK | The status of the Rescue user was successfully changed. |
NOTLOGGEDIN | Changing the Rescue user's status failed because the current user is no longer logged in. |
INVALIDPARAM_STATUS | The specified status does not exist. |
INVALIDPARAM_NODE | The specified ID is not the ID of an existing Rescue user. |
INVALID_SECRETAUTHCODE | The secret authentication code for the user is invalid. |
USER_DELETED_OR_DISABLED | The user who is trying to change the status of another Rescue user is deleted or disabled. |
Sample Code
The following are examples for using the setUserStatus_v7_1 method that you can call in your environment.
HTTP GET
https://secure.logmeinrescue.com/API/setUserStatus_v7_1.aspx?node=337366&status=disabled
&authcode=4ahx...80u0
HTTP POST
<form method="post" action="https://secure.logmeinrescue.com/API/setUserStatus_v7_1.aspx">
<input name="node" value="337366">
<input name="status" value="disabled">
</form>
SOAP
For sample SOAP 1.1 and SOAP 1.2 request and response messages, visit https://secure.logmeinrescue.com/api/API.asmx?op=setUserStatus_v7_1.
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'
);
$iNodeID = 123456;
$eStatus = Enabled;
$sAuthCode = "4ahx...80u0";
$setuserparams = array (
'iNodeID' => $iNodeID,
'eStatus' => $eStatus,
'sAuthCode' => $sAuthCode
);
$loginResult = $soapclient->login($loginparams);
print_r($loginResult);
$setUserResult = $soapclient->setUserStatus_v7_1($setuserparams);
print_r($setUserResult);
?>
C# with HttpWebRequest
The example values shown must be replaced with actual values.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.IO;
namespace setUser
{
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";
string sNode = "ID of node being updated";
string sStatus = "Status of node (Enabled | Disabled)";
string sAuthCode = "";
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 oReqSetUser = (HttpWebRequest)WebRequest.Create(sEndpoint +
"setuserstatus_v7_1.aspx" + "?node=" + sNode + "&status=" + sStatus + "&authcode=" + sAuthCode);
oReqSetUser.CookieContainer = sessioncookie;
HttpWebResponse oRespSetUser = (HttpWebResponse)oReqSetUser.GetResponse();
string sRespSetUser = new StreamReader(oRespSetUser.GetResponseStream())
.ReadToEnd();
Response.Write(sRespSetUser + "<br />");
}
catch (Exception ex)
{
lblError.Text = 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.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.IO;
using setUser.WebServiceClients;
namespace setUser
{
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";
int iNode = Node ID of user being modified;
string sAuthCode = "";
WebServiceClients.API proxy = new WebServiceClients.API();
WebServiceClients.loginRet loginResult = proxy.login(sEmail, sPwd);
Response.Write(loginResult + "<br />");
WebServiceClients.setUserRet setUserReturn = proxy.setUserStatus_v7_1(iNode,
nodeStatus.Enabled, sAuthCode);
Response.Write(setUserReturn + "<br />");
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
}
}
}