LogMeIn Rescue API User Guide

assignChannel

Assigns a channel to a technician or Technician Group. For information about assigning channels in the Rescue Administration Center, see How to Assign a Channel to a Technician Group in the LogMeIn Rescue Administration Center User Guide.

Input Parameters

Element Description
node The ID of the technician or Technician Group. Required.
entry The ID of the channel that you want to assign. 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 Assigning a channel succeeded.
NOTLOGGEDIN Assigning a channel failed because the current user is no longer logged in.
INVALIDPARAM_NODE The ID of a technician or a Technician Group is not defined.
INVALIDPARAM_ENTRY The ID of a channel is not defined.
INVALID_ASSIGN The channel cannot be assigned to the selected node because it is not an existing technician or Technician 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 assignChannel method that you can call in your environment.

HTTP GET

https://secure.logmeinrescue.com/API/assignChannel.aspx?node=337364
&entry=1902861082&authcode=...

HTTP POST

<form method="post" action="https://secure.logmeinrescue.com/API/assignChannel.aspx">
        <input name="node" value="337364">
        <input name="entry" value="1902861082">
        <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=assignChannel.

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'
	);

	$assignchannelparams = array (
	 'iEntryID' => 1902861082,
		'iNodeID' => 337364,
		'sAuthCode' => '4ahx...80u0'
	);

	$loginResult = $soapclient->login($loginparams);

	print_r($loginResult);

	$assignChannelResult = $soapclient->assignChannel($assignchannelparams);
	
	print_r($assignChannelResult);
?>

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 assignChannel
{
    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 = 337364;
            int iEntry = 1902861082;
            //sAuthCode is the return value of the requestAuthCode API call
            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 oAssign = (HttpWebRequest)WebRequest.Create(sEndpoint +
 "assignChannel.aspx" + "?node=" + iNode + "&entry=" + iEntry + "&authcode=" + sAuthCode);
            oAssign.CookieContainer = sessioncookie;

            HttpWebResponse oAssignResp = (HttpWebResponse)oAssign.GetResponse();
            string sAssignResp = new StreamReader(oAssignResp.GetResponseStream())
.ReadToEnd();
            Response.Write(sAssignResp);
            }
            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;

namespace assignChannel
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string sEmail = "some@email.com";
                string sPwd = "secretpassword";
                int iNode = 337364;
                int iEntry = 1902861082;
                //sAuthCode is the return value of the requestAuthCode API call
                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.assignChannelRet oAssign = proxy.assignChannel(iEntry,
 iNode, sAuthCode);
                Response.Write(oAssign);
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message;
            }
        }
    }
}