holdSession
An administrator can put a technician session on hold. You can do this from the Sessions tab of the Rescue Administration Center.
Input Parameters
Element | Description |
---|---|
session | The ID of the target session. 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 | Putting the session on hold succeeded. |
NOTLOGGEDINASADMIN | Putting the session on hold failed because the administrator is not logged in. |
ACTIONFAILED | Putting the session on hold failed because, for example, the session is on hold. |
INVALIDPARAM_SESSION | The type of the session ID is incorrect. The type must be an integer. |
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 holdSession method that you can call in your environment.
HTTP GET
https://secure.logmeinrescue.com/API/holdSession.aspx?session=12345678&authcode=4ahx...80u0
HTTP POST
<form method="post" action="https://secure.logmeinrescue.com/API/holdSession.aspx">
<input name="session" value=12345678>
<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=holdSession.
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'
);
$iSessionID = 12345678
$sAuthCode = "4ahx...80u0";
$holdsessionparams = array (
'iSessionID' => $iSessionID,
'sAuthCode' => ''
);
$loginResult = $soapclient->login($loginparams);
print_r($loginResult);
$holdSessionResult = $soapclient->holdSession($holdsessionparams);
print_r($holdSessionResult);
?>
C# with HttpWebRequest
The example values shown must be replaced with actual values.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using apiSamples.WebServiceClients;
namespace apiSamples
{
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";
//sAuthCode is the return value from the requestAuthCode API
string sAuthCode = "4ahx...80u0";
HttpWebRequest oReqLogin = (HttpWebRequest)WebRequest.Create(sEndpoint
+ "login.aspx?email=" + sEmail + "&pwd=" + sPwd);
oReqLogin.CookieContainer = new CookieContainer();
HttpWebResponse oRespLogin = (HttpWebResponse)oReqLogin.GetResponse();
string sRespLogin = new StreamReader(oRespLogin.GetResponseStream())
.ReadToEnd();
Response.Write(sRespLogin + "<br />");
CookieContainer sessioncookie = oReqLogin.CookieContainer;
HttpWebRequest oReqHoldSession = (HttpWebRequest)WebRequest.Create(sEndpoint
+ "holdSession.aspx?session=123456&authcode=" + sAuthCode);
oReqHoldSession.CookieContainer = sessioncookie;
HttpWebResponse oRespHoldSession = (HttpWebResponse)
oReqHoldSession.GetResponse();
string sRespHoldSession = new StreamReader(oRespHoldSession
.GetResponseStream()).ReadToEnd();
Response.Write(sRespHoldSession + "<br />");
}
catch (Exception ex)
{
Response.Write(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.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using apiSamples.WebServiceClients;
namespace apiSamples
{
public partial class SOAP : 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";
int iSession = 12345678;
WebServiceClients.loginRet oLogin = proxy.login(sEmail, sPwd);
Response.Write(oLogin + "<br />");
WebServiceClients.holdSessionRet oHoldSession = proxy.holdSession(iSession,
sAuthCode);
Response.Write(oHoldSession + "<br />");
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
}
}