tags:

views:

95

answers:

1

The LogMeIn API's "getSession" call is driving me a bit crazy. According to their documentation, you should be able to input an iNodeID either from the getHierarchy call or just the tech's ID# from the LogMeIn admin page and it will report their open session information, but no matter what I use, I get an error "stdClass Object ( [getSessionResult] => getSession_InvalaidParam_NodeID )" Has anyone ever seen this?

Here is my code:

    <?php
    require("/usr/local/lib/php/nusoap/nusoap.php");
    $loginParams = array(
          'sEmail' => *hidden*,
          'sPassword' => *hidden*
          );
    $soapclient = new soapclient("https://secure.logmeinrescue.com/API/API.asmx?WSDL");
    $loginResult = $soapclient->login($loginParams);
    $hierparams = array(""=>"");
    $hierarchyResult = $soapclient->getHierarchy($hierparams);
    $hierarchy = $hierarchyResult->aHierarchy;
    $nodes = $hierarchy->HIERARCHY;
    $numberofnodes = count($nodes);
    echo "<table border =\"0\" cellspacing = \"5\">";
    for ($iNodes = 0; $iNodes < $numberofnodes; $iNodes += 1)
    {
      if($nodes[$iNodes]->eStatus == "Online" && $nodes[$iNodes]->eType == "Technician"){
        print_r("<tr>");
        print_r("<td>Name: " . $nodes[$iNodes]->sName . "<br /></td>");

 ####This works
        print_r("<td>ID: " . $nodes[$iNodes]->iNodeID . "<br /></td>");.
 ###############

        print_r("<td>Email: " . $nodes[$iNodes]->sEmail . "<br /></td>");

 ####This doesn't.
        $sessioninfo = $soapclient->getSession($nodes[$iNodes]->iNodeID);
 ################
        print_r("<td>Session Dump: ". print_r($sessioninfo) . "</td>");
        print_r("</td>");
       }
    }
    print_r("</table>");
    $soapclient->logout();
    ?>
A: 

Turns out there was a parameter that I overlooked, eNodeRef, which has a default parameter of "NODE".

$iNodeID = $nodes[$iNodes]->iNodeID;
$eNodeRef = "NODE";
$sessionparams = array(
      'iNodeID' => $iNodeID,
      'eNodeRef' => $eNodeRef
      );
$sessionresult = $soapclient->getSession($sessionparams);
Nate