LogMeIn API - getSession?
LogMeIn API 的“getSession”调用让我有点抓狂。根据他们的文档,您应该能够从 getHierarchy 调用中输入 iNodeID,或者从 LogMeIn 管理页面输入技术人员的 ID#,它将报告他们的打开会话信息,但无论我使用什么,我都会收到错误“ stdClass Object ( [getSessionResult] => getSession_InvalaidParam_NodeID )" 有人见过这个吗?
这是我的代码:
<?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();
?>
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();
?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
结果发现有一个参数被我忽略了,eNodeRef,它有一个默认参数“NODE”。
Turns out there was a parameter that I overlooked, eNodeRef, which has a default parameter of "NODE".