deleteNode
Deletes a node from the company hierarchy. You can delete a node in the Rescue Administration Center by right-clicking on the node and selecting Delete.
Input Parameters
| Element | Description | 
|---|---|
| node | The ID of the node to delete. Required. | 
| 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, such as timeout. | 
| OK | Deleting a node succeeded. | 
| NOTLOGGEDIN | Deleting a node failed because the current user is no longer logged in. | 
| INVALIDPARAM_NODE | The specified ID is not the ID of an existing node. | 
| INVALID_DELETE | The node cannot be deleted because the user who is currently logged in has insufficient privileges. An administrator cannot delete himself either. | 
| INVALID_SECRETAUTHCODE | The secret authentication code for the user is invalid. | 
| USER_DELETED_OR_DISABLED | The user is deleted or disabled. | 
Sample Code
The following are examples for using the deleteNode method that you can call in your environment.
HTTP GET
https://secure.logmeinrescue.com/API/deleteNode.aspx?node=337366&authcode=4ahx...80u0HTTP POST
<form method="post" action="https://secure.logmeinrescue.com/API/deleteNode.aspx">
        <input name="nodeID" value="337366">
        <input name="authcode" value="4ahx...80u0">
</form>
SOAP
For sample SOAP 1.1 and SOAP 1.2 request and response messages, visit https://secure.logmeinrescue.com/api/API.asmx?op=deleteNode.
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'
	);
	$deletenodeparams = array (
		'iNodeID' => 337366,
		'sAuthCode' => '4ahx...80u0'
	);
	$loginResult = $soapclient->login($loginparams);
	print_r($loginResult);
	$deleteNodeResult = $soapclient->deleteNode($deletenodeparams);
	
	print_r($deleteNodeResult);
?>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;
using deleteNode.WebServiceClients;
namespace deleteNode
{
    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 = 337366;
                string sAuthCode = "4ahx...80u0"
                HttpWebRequest oReqLogin = (HttpWebRequest)WebRequest.Create(sEndpoint +
 "login.aspx" + "?email=" + sEmail + "&pwd=" + sPwd);
                oReqLogin.CookieContainer = new CookieContainer();
                CookieContainer sessioncookie = oReqLogin.CookieContainer;
                HttpWebResponse oLoginResp = (HttpWebResponse)oReqLogin.GetResponse();
                string sLoginResp = new StreamReader(oLoginResp.GetResponseStream())
.ReadToEnd();
                Response.Write(sLoginResp + "<br />");
                HttpWebRequest oReqDeleteNode = (HttpWebRequest)WebRequest.Create
(sEndpoint + "deleteNode.aspx" + "?node=" + iNode + "&authcode=" + sAuthCode);
                HttpWebResponse oDeleteNodeResp = (HttpWebResponse)
oReqDeleteNode.GetResponse();
                string sDeleteNodeResp = new StreamReader
(oDeleteNodeResp.GetResponseStream()).ReadToEnd();
                Response.Write(sDeleteNodeResp);
            }
            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 deleteNode.WebServiceClients;
namespace deleteNode
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string sEmail = "some@email.com";
            string sPwd = "secretPassword";
            int iNode = 337366;
            string sAuthCode = "4ahx...80u0";
            WebServiceClients.API proxy = new WebServiceClients.API();
            proxy.CookieContainer = new CookieContainer();
            WebServiceClients.loginRet loginResult = proxy.login(sEmail, sPwd);
            Response.Write(loginResult + "<br />");
            WebServiceClients.deleteNodeRet oDeleteNode = proxy.deleteNode(iNode, sAuthCode);
            Response.Write(oDeleteNode);
        }
    }
}


