ShowSession
- Method
SlimCD.Sessions.ShowSession
Purpose
Displays the session inside the browser.
Description
ShowSession is used to display a previously-created session. It is designed to accept limited input and display HTML output so that the SessionID value can be included in the URL that is provided as a command-line when launching in a browser. This also works well when redirecting from one web server to another.
Business Rules
Argument List
Name Required Usage ShowSessionRequest Required Object containing properties for the request timeout Optional Integer wait time, in seconds, before timeout response is generated callback* Optional Function to call upon completion of asynchronous request *for JavaScript only
ShowSession Request Fields
Field Name Type Length Required Description SessionID string 40 require HEX string uniquely representing the session Reply Fields
ShowSession is used to display HTML in a browser or browser control.
- For browser-based references: HTML is displayed.
- For class libraries: It returns a formatted URL.
Reply Hierarchy
It returns either a URL or HTML, not intended to be a structured document to parse.
Remarks
- ShowSession requires a single input field, the SessionID. A form is displayed based on the configuration settings for the form on the SLIM CD server.
- The ShowSession service returns an HTML web page for display in a browser. The displayed form and the actions of that form can be managed using the SLIM CD HOSTED PAYMENT PAGES functionality in the SLIM CD website.
- When using libraries, the libraries will return a formatted url with the specified sessionid
(ex: https://stats.slimcd.com/soft/showsession.asp?sessionid=….) - When using JavaScript/PHP (web-based languages), ShowSession will set the browser’s location so that the HTML is displayed (it will redirect the browser to the created url)
- It is possible to configure HOSTED PAYMENT PAGES to perform a PostBack and/or Redirection at the end of the payment. Alternatively, the CheckSession and CancelSession functions can be used to monitor the outcome of the activity in a HOSTED PAYMENT PAGE.
Examples
Sample HTTP GET:
Sample HTTP POST:
Sample HTML Form with POST:
- Include
012<script type="text/javascript" src="https://trans.slimcd.com/soft/json/slimcd.js"></script>
Method
123function ShowSession(sessionid)
Request
123456request={"sessionid": "6B9AC5C22EF62BB46EDBC2D2C49215D1157E3439"}
Reply
123456789callback ({window.location.href = SlimCD.internal.getStatsServer() + "/soft/showsession.asp?sessionid=" +sessionid});
Sample Code
12345678910<script type="text/javascript" src="https://trans.slimcd.com/soft/json/slimcd.js"></script><script type="text/javascript">SlimCD.Sessions.ShowSession({"sessionid": "6B9AC5C22EF62BB46EDBC2D2C49215D1157E3439"});</script>
Downloads
- Include
012include 'slimcd.php';
Method
123function Sessions_ShowSession(Sessions_ShowSessionRequest $request)Request
1234567class Sessions_ShowSessionRequest {// property declarationpublic $SessionID="";}JSON Reply
1234{return( $this->statsURL . "/soft/showsession.asp?sessionid=" . urlencode($request->SessionID) );}Sample Code
123456789101112include 'slimcd.php';// Create the Slim CD object$SlimCD = new SlimCD() ;// Create a ShowSession Request class$request = new Sessions_ShowSessionRequest() ;$request->sessionid = "6B9AC5C22EF62BB46EDBC2D2C49215D1157E3439";$result = $SlimCD->Sessions_ShowSession($request);Downloads Download full sample source.
- Include
123using SlimCD;
Method
123public String ShowSessionURL(String SessionId);
Request
123456public class ShowSessionRequest{public string sessionid { get; set; };}
Reply
123Displays the form chosen in the "formname" parameter of CreateSession request.
Cross Reference: ClientSample Code
12345678String sessionid = "6B9AC5C22EF62BB46EDBC2D2C49215D1157E3439";String sessionURL = "https://stats.slimcd.com/soft/showsession.asp?sessionid=" + sessionid;lblURL.Text = sessionURL;webbrowser.Url = new Uri(sessionURL);}Downloads Download full sample source.
- Include
123using SlimCD;
Method
012public async Task< String > ShowSessionURL(String SessionId);
Request
123456public class ShowSessionRequest{public string sessionid { get; set; };}
Reply
123Displays the form chosen in the "formname" parameter of CreateSession request.
Cross Reference: ClientSample Code
123456String sessionid = "6B9AC5C22EF62BB46EDBC2D2C49215D1157E3439";String sessionURL = "https://stats.slimcd.com/soft/showsession.asp?sessionid=" + sessionid;lblURL.Text = sessionURL;webbrowser.Url = new Uri(sessionURL);Downloads Download full sample source.
- Include
012#import "SlimCD.h"
Method
123- (NSString*) sessionsShowSessionWithSession:(NSString*)sessionID;Request
1Session IDReply
1NSString containing URL to launchSample Code
1234567891011121314151617SlimCD *api = [[SlimCD alloc] init];NSString *sessionID = @"12345";NSString *urlString = [api sessionsShowSessionWithSession:sessionID];NSURL *url = [NSURL URLWithString:urlString];if ([[UIApplication sharedApplication] canOpenURL:url]){[[UIApplication sharedApplication] openURL:url];}else{NSLog(@"Cannot launch URL.");} - Method
123public String getShowSession(ShowSessionRequest sessionShowRequest)
Request
12345678910111213141516171819202122public class ShowSessionRequest{// request parameter.private String sessionid;public ShowSessionRequest(){// set default values.sessionid="";}// setters and getters.public String getSessionid() {return sessionid;}public void setSessionid(String sessionid) {this.sessionid = sessionid;}}
Reply
123Sample Code
1234567// Set the request parameter.ShowSessionRequest request =new ShowSessionRequest();request.setSessionid("4BC8FB1927A2BD499A22E7EDCA1D6CA3F709A5C8");String result= new SessionShowSession().getShowSession(request);Downloads Download full sample source.
- URL
Protocols
- SOAP/XML
- HTTP POST
- HTTP GET
Request
Status Codes
Status Code Status Description Explanation 200 200 OK Approved or declined attempts will return a response with an XML reply block 500 500 Internal Server Error The response will not contain XML, as a server error has occurred. Reply Output is in XML format if a status code of 200 is returned.
123Output will be an HTML codeIf the block’s tag does not indicate “Success”, the tag will contain an error description which can be displayed to the end-user
Sample Code
Simple HTML form to show ShowSession
Remarks
- Remarks Go here
- URL
123https://stats.slimcd.com/soft/showsession.asp
Protocols- HTTP POST
- HTTP GET
This function accepts either name/value pairs or JSON
Request
Reply
123Displays the form chosen in the "formname" parameter of CreateSession request.Sample Code
Remarks
- None