moveNode
Moves a node from one parent node to another in the company hierarchy. This is equivalent to performing a drag and drop on a node in the organization tree.
Input Parameters
Element | Description |
---|---|
targetNode | The ID of the node that will be the new parent node. Required. |
node | The ID of the node that you want to move. 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 | Moving a node succeeded. |
NOTLOGGEDIN | Moving a node failed because the current user is no longer logged in. |
INVALIDPARAM_NODE | The specified ID is not the ID of an existing source node. |
INVALIDPARAM_TARGETNODE | The specified ID is not the ID of an existing target node. |
INVALID_MOVE | The node cannot be moved to the target node because the target node does not exist or the specified node that you want to move cannot be the child of the target node. For example, a technician cannot be moved to an Administrator Group. |
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 moveNode method that you can call in your environment.
HTTP GET
https://secure.logmeinrescue.com/API/moveNode.aspx?targetnode=337364&node=337366
&authcode=4ahx...80u0
HTTP POST
<form method="post" action="https://secure.logmeinrescue.com/API/moveNode.aspx">
<input name="targetNodeID" value="337364">
<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=moveNode.
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'
);
$iTargetNodeID = 337364;
$iNodeID = 337366;
$sAuthCode = "4ahx...80u0";
$movenodeparams = array (
'iTargetNodeID' => $iTargetNodeID,
'iNodeID' => $iNodeID,
'sAuthCode' => ''
);
$loginResult = $soapclient->login($loginparams);
print_r($loginResult);
$moveNodeResult = $soapclient->moveNode($movenodeparams);
print_r($moveNodeResult);
?>
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 createGroup.WebServiceClients;
namespace createGroup
{
public partial class WebForm1 : 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 iTargetNode = 337364;
int iNode = 337366;
string sAuthCode = "4ahx...80u0"l
HttpWebRequest oReqLogin = (HttpWebRequest)WebRequest.Create(sEndpoint +
"login.aspx" + "?email=" + sEmail + "&pwd=" + sPwd);
oReqLogin.CookieContainer = new CookieContainer();
CookieContainer sessioncookie = oReqLogin.CookieContainer;
HttpWebResponse oRespLogin = (HttpWebResponse)oReqLogin.GetResponse();
string sRespLogin = new StreamReader(oRespLogin.GetResponseStream())
.ReadToEnd();
Response.Write(sRespLogin + "<br />");
HttpWebRequest oReqMoveNode = (HttpWebRequest)WebRequest.Create(sEndpoint +
"movenode.aspx" + "?targetnode=" + iTargetNode + "&node=" + iNode + "&authcode="
+ sAuthCode);
oReqMoveNode.CookieContainer = sessioncookie;
HttpWebResponse oRespMoveNode = (HttpWebResponse)oReqMoveNode.GetResponse();
string sRespMoveNode = new StreamReader(oRespMoveNode.GetResponseStream())
.ReadToEnd();
Response.Write(sRespMoveNode);
}
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 createGroup.WebServiceClients;
namespace createGroup
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
string sEmail = "some@email.com";
string sPwd = "secretPassword";
int iTargetNode = 337364;
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.moveNodeRet oMoveNode = proxy.moveNode(iTargetNode, iNode,
sAuthCode);
Response.Write(oMoveNode);
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
}
}
}