LogMeIn Rescue API User Guide

getUser

Retrieves information about a specific user. You can see this information in the Rescue Administration Center by selecting a user in the organization tree.

Input Parameters

Element Description
node The ID of the user whose information you want to retrieve. Required.
authcode The secret authentication code that is used to authenticate the user without logging in to Rescue. Optional.

Output

OK NODEID: 337366 NAME: John Doe NICK: EMAIL: jdoe@company.com SSOID: DESCRIPTION: 
TYPE: Technician HASMOBILEADDON: False ISACCOUNTHOLDER: True STATUS: Online 
NODEID: ID of the user whose information you want to retrieve
NAME: Username
NICK: Nickname of the user
EMAIL: User's email
SSOID: Single Sign On ID of the user
DESCRIPTION: User's description
TYPE: Type of the user, which is either Technician, Administrator, or MasterAdministrator
HASMOBILEADDON: Displays whether the user has mobile addon
ISACCOUNTHOLDER: Displays whether the user is an account holder
STATUS: Status of the user

Return Values

Displayed Return Value Description
ERROR An unspecified error occurred, such as timeout.
OK Retrieving information about a user succeeded.
NOTLOGGEDIN Retrieving information about a user failed because the current user is no longer logged in.
INVALIDPARAM_NODE The specified ID is not the ID of an existing user.
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 getUser method that you can call in your environment.

HTTP GET

https://secure.logmeinrescue.com/API/getUser.aspx?node=337366&authcode=4ahx...80u0

HTTP POST

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

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 = 337366;

	$getuserparams = array (
		'iNodeID' => $iNodeID,
		'sAuthCode' => '4ahx...80u0'
	);

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

	print_r($loginResult);

	$getUserResult = $soapclient->getUser($getuserparams);
	
	print_r($getUserResult);
?>

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 getUser
{
   public partial class WebForm2 : System.Web.UI.Page
   {
      protected void Page_Load(object sender, EventArgs e)
      {
        string sEndpoint = "https://secure.logmeinrescue.com/api/";
        string sEmail = "some@email.com";
        string sPwd = "secretPassword";
        int iNode = 337366;
        string sAuthCode = "4ahx...80u0";

        HttpWebRequest oLogin = (HttpWebRequest)WebRequest.Create(sEndpoint 
+ "login.aspx" + "?email=" + sEmail + "&pwd=" + sPwd);
        oLogin.CookieContainer = new CookieContainer();

        HttpWebResponse oLoginResp = (HttpWebResponse)oLogin.GetResponse();
        string sLoginResp = new StreamReader(oLoginResp.GetResponseStream()).ReadToEnd();
        Response.Write(sLoginResp);

        CookieContainer sessioncookie = oLogin.CookieContainer;

        HttpWebRequest oReq = (HttpWebRequest)WebRequest.Create(sEndpoint 
+ "getUser.aspx" + "?node=" + iNode + "&authcode=" + sAuthCode);
        oReq.CookieContainer = sessioncookie;

        HttpWebResponse oResp = (HttpWebResponse)oReq.GetResponse();
        string sResp = new StreamReader(oResp.GetResponseStream()).ReadToEnd();
        Response.Write(sResp);
      }
   }
}

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 API.WebServiceClients;

namespace getUser
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                WebServiceClients.API proxy = new WebServiceClients.API();
                proxy.CookieContainer = new CookieContainer();

                string sEmail = "some@email.com";
                string sPwd = "secretPassword";
                string sAuthCode = "4ahx...80u0";

                WebServiceClients.loginRet loginResult = proxy.login(sEmail, sPwd);
                Response.Write(loginResult + "<br />");

                int iNodeID = [ID of node in which information is being retrieved];
                User oUser = new User();

                WebServiceClients.getUserRet getResult = proxy.getUser(iNodeID, sAuthCode,
 out oUser);
                Response.Write(getResult + oUser.sName + oUser.sEmail [etc...]);
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message;
            }
        }
    }
}