SearchSessions
- Method
SlimCD.Sessions.SearchSessions
Purpose
Search Sessions.
Description
Returns a list of all the session matching the search criteria. Search is performed on a date range. Returned data includes session id, approved, approvedamt, etc.
The search itself can contain any of the following items:- clientid
- siteid
- sessionid
- gateid
- transtype
- amount
- approvedAmt
- cardpart
- approved
- cancelled
- completed
- reverseorder
Business Rules
Argument List
Name Required Usage SearchSessionRequest 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
SearchSessions Request Fields
Field Name Type Length Required Description SessionID string 40 require HEX string uniquely representing the session . Amount string 20 require Amount of the transaction. 1. Passwords are required except when the username is set to an API Access Credential, in which case it should be passed in as an empty string.
Reply Fields
reply outer tag for the reply data block response Success, FAIL, Error response code 0, 1, 2 (respective) matching the above reponseurl The Slimcd.com url which was called for this operation description If successful, this will contain the single word, OK. Otherwise it will contain a description of failure or error which occurred reponseurl The Slimcd.com url which was called for this operation datablock The confirmation text returned from the server. Reply Hierarchy
- reply
- response
- responsecode
- description
- responseurl
- datablock
- Sessions
- Session
- SessionID
- Date
- FormID
- ClientID
- SiteID
- SiteName
- PriceID
- TransType
- first6
- last4
- Approved
- Amount
- ApprovedAmt
- Reason
- GateID
- AuthCode
- AVSReply
- CVV2Reply
- Cancelled
- Completed
- processortoken
- decline_count
- template_flag
- Session
- Sessions
Remarks
- General
- Names in name/value pairs are NOT case-sensitive
- Names inside XML tags ARE case-sensitive
- Function-Specific
- None
- Include
012<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script>
Method
1234function SearchSessions(request,callback)function SearchSessions(request,timeout,callback)
Request
1234567891011121314151617181920request= {"username": "1032","password": "289075","startdate": "","enddate": "","clientid": "","siteid": "","sessionid": "","amount": "","approvedamt": "","transtype": "","cardpart": "","approved": "","gateid": "","completed": "","cancelled": "","reverseorder": "0"}
Reply
12345678910111213141516171819202122232425262728293031323334353637383940callback ( {"reply":{"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/sessions.asmx/SearchSessions","datablock": {"Sessions": {"Session": {"SessionID": "0C7622D38DA638D3D167CBB736A75A46FDC4D873","Date": "7/22/2013 1:27:57 AM","FormID": "67","FormName": "simple","ClientID": "1032","SiteID": "228226448","SiteName": "retail test 111","PriceID": "74","TransType": "SALE","first6": null,"last4": null,"Approved": "U","Amount": "10.0000","ApprovedAmt": null,"Reason": null,"GateID": null,"AuthCode": null,"AVSReply": null,"CVV2Reply": null,"Cancelled": "False","Completed": "False","processortoken": null,"decline_count": "0","template_flag": "False"}}}}} );
Sample Code
12345<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script><script>// <![CDATA[SlimCD.Sessions.SearchSessions( { "username": "1032", "password": "289075", "startdate": "", "enddate": "", "clientid": "", "siteid": "", "sessionid": "", "amount": "", "approvedamt": "", "transtype": "", "cardpart": "", "approved": "", "gateid": "", "completed": "", "cancelled": "", "reverseorder": "0" }, function (reply) { if (reply.response == "Success") { alert ('Batch Closed'); } else { alert('There was a problem closing the batch:\r\n' + reply.description); } } );// ]]></script>
Downloads
- Include
012include 'slimcd.php';
Method
123function Sessions_SearchSessionss(Sessions_SearchSessionssRequest $request,$timeout=false)Request
123456789101112131415161718192021222324class Sessions_SearchSessionsRequest{// property declarationpublic $username = '';public $password = '';public $startdate='';public $EndDate=0;public $ClientID=0;public $SiteID=0;public $SessionID=0;public $Amount=0;public $Approvedant='';public $TransType='';public $CardPart='';public $Approved ='';public $GateID=0;public $Completed='';public $Cancelled ='';public $ReverseOrder='';}JSON Reply
1234567891011121314151617181920212223242526272829303132333435363738{"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/sessions.asmx/SearchSessions","datablock": {"Sessions": {"Session": {"SessionID": "0C7622D38DA638D3D167CBB736A75A46FDC4D873","Date": "7/22/2013 1:27:57 AM","FormID": "67","FormName": "simple","ClientID": "1032","SiteID": "228226448","SiteName": "retail test 111","PriceID": "74","TransType": "SALE","first6": null,"last4": null,"Approved": "U","Amount": "10.0000","ApprovedAmt": null,"Reason": null,"GateID": null,"AuthCode": null,"AVSReply": null,"CVV2Reply": null,"Cancelled": "False","Completed": "False","processortoken": null,"decline_count": "0","template_flag": "False"}}}}Sample Code
1234567891011121314151617181920212223242526272829include 'slimcd.php';// Create a SearchSessions Request class$request = new Sessions_SearchSessionsRequest() ;$request->username = '1032';$request->password = '289075';$request->startdate = "";$request->enddate = "";$request->clientid = "";$request->siteid =0;$request->sessionid ="";$request->amount = '0.00';$request->approvedamt = "";$request->transtype= "";$request->cardpart = "";$request->approved = "";$request->gateid ='0' ;$request->completed = "" ;$request->cancelled = "" ;$request->reverseorder = '0' ;if ($result->response == 'Success') {echo 'Success!' ;}else {echo $result->response . ':' . $result->description ;}Downloads
Download full sample source. - Include
123using SlimCD;
Method
123public SearchSessionsReply SearchSessions(SearchSessionsRequest request, int timeout);
Request
123456789101112131415161718192021public class SearchSessionsRequest{public string username { get; set; }public string password { get; set; }public int clientid { get; set; }public int siteid { get; set; }public string startdate { get; set; }public string enddate { get; set; }public string sessionid { get; set; }public string amount { get; set; }public string approvedamt { get; set; }public string transtypepublic string cardpart { get; set; }public string approved { get; set; }public int gateid { get; set; }public string completed { get; set; }public string cancelled { get; set; }public string reverseorder { get; set; }}
Reply
123456789101112public class SearchSessionsReply{public string response;public string responsecode;public string description;public string responseurl;public string Sessions;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
12345678910111213141516171819202122232425262728SlimCD.Sessions sessions = new SlimCD.Sessions();sessions.debug = true;sessions.transURL = TransURL;sessions.statsURL = StatsURL;SearchSessionsRequest request = new SearchSessionsRequest();SearchSessionsReply reply = new SearchSessionsReply();request.username = 1032;request.password = 289075;request.startdate = "";request.enddate = "";request.clientid = "";request.siteid = "";request.amount = "";request.transtype = "";request.cardpart = "";request.gateid = "";request.reverseorder = 0;reply = sessions.SearchSessions(request, 60);if (reply.response.ToUpper() == "SUCCESS"){MessageBox.Show("Success");}else{MessageBox.Show("There was a problem:\n(" + reply.response & ") " + reply.description);}Downloads
Download full sample source. - Include
123using SlimCD;
Method
012public async Task SearchSessions(SearchSessionsRequest request, int timeout);
Request
123456789101112131415161718192021public class SearchSessionsRequest{public string username { get; set; }public string password { get; set; }public int clientid { get; set; }public int siteid { get; set; }public string startdate { get; set; }public string enddate { get; set; }public string sessionid { get; set; }public string amount { get; set; }public string approvedamt { get; set; }public string transtypepublic string cardpart { get; set; }public string approved { get; set; }public int gateid { get; set; }public string completed { get; set; }public string cancelled { get; set; }public string reverseorder { get; set; }}
Reply
123456789101112public class SearchSessionsReply{public string response;public string responsecode;public string description;public string responseurl;public string sessionid;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
12345678910111213141516171819202122232425262728SlimCD.Sessions sessions = new SlimCD.Sessions();sessions.debug = true;sessions.transURL = TransURL;sessions.statsURL = StatsURL;SearchSessionsRequest request = new SearchSessionsRequest();SearchSessionsReply reply = new SearchSessionsReply();request.username = 1032;request.password = 289075;request.startdate = "";request.enddate = "";request.clientid = "";request.siteid = "";request.amount = "";request.transtype = "";request.cardpart = "";request.gateid = "";request.reverseorder = 0;reply = await sessions.SearchSessions(request, 60);if (reply.response.ToUpper() == "SUCCESS"){MessageBox.Show("Success");}else{MessageBox.Show("There was a problem:\n(" + reply.response & ") " + reply.description);}Downloads
- Include
012#import "SlimCD.h"Method
1234567typedef void (^SessionsSearchSessionsReplyBlock)(SessionsSearchSessionsReply *reply);- (void) sessionsSearchSessionsWithRequest:(SessionsSearchSessionsRequest*)request replyBlock:(SessionsSearchSessionsReplyBlock)replyBlock;- (void) sessionsSearchSessionsWithRequest:(SessionsSearchSessionsRequest*)request timeout:(NSTimeInterval)timeout replyBlock:(SessionsSearchSessionsReplyBlock)replyBlock;Request
12345678910111213141516171819202122@interface SessionsSearchSessionsRequest@property (strong) NSString *userName;@property (strong) NSString *password;@property (strong) NSDate *startDate;@property (strong) NSDate *endDate;@property (strong) NSString *sessionID;@property (strong) NSNumber *clientID;@property (strong) NSNumber *siteID;@property (strong) NSString *amount;@property (strong) NSString *approvedAmt;@property (strong) NSString *transType;@property (strong) NSString *cardPart;@property (strong) NSString *approved;@property (strong) NSNumber *gateID;@property (strong) NSString *completed;@property (strong) NSString *cancelled;@property (strong) NSNumber *reverseOrder;@endReply
12345678910111213141516171819202122232425262728293031323334353637@interface SessionsSearchSessionsReply : SlimCDReply// Array of SessionsSearchSession objects.@property (strong) NSArray *sessions;@end@interface SessionsSearchSession : SlimCDObject@property (strong) NSString *sessionID;@property (strong) NSString *date;@property (strong) NSString *formID;@property (strong) NSString *formName;@property (strong) NSNumber *clientID;@property (strong) NSNumber *siteID;@property (strong) NSString *siteName;@property (strong) NSNumber *priceID;@property (strong) NSString *transType;@property (strong) NSString *first6;@property (strong) NSString *last4;@property (strong) NSString *approved;@property (strong) NSString *amount;@property (strong) NSString *approvedAmt;@property (strong) NSString *reason;@property (strong) NSNumber *gateID;@property (strong) NSString *authCode;@property (strong) NSString *avsReply;@property (strong) NSString *cvv2Reply;@property (strong) NSString *cancelled;@property (strong) NSString *completed;@property (strong) NSString *processorToken;@property (strong) NSString *declineCount;@property (strong) NSString *templateFlag;@endSample Code
12345678910111213141516171819202122SlimCD *api = [[SlimCD alloc] init];SessionsSearchSessionsRequest *request = [[SessionsSearchSessionsRequest alloc] init];request.userName = @"1032";request.password = @"289075";request.reverseOrder = @0;request.startDate = [NSDate date];request.endDate = [NSDate date];[api sessionsSearchSessionsWithRequest:request replyBlock:^(SessionsSearchSessionsReply *reply ){if ( reply.responseCode == RC_SUCCESS ){NSLog(@"Session results returned successfully.");}else{NSLog(@"Unable to load session results.");}}]; - Method
1234567public void getSearchSessions(SearchSessionsRequest SessionsSearchRequest,int timeout ,SearchSessionsCallback callback)public void getSearchSessions(SearchSessionsRequest SessionsSearchRequest,SearchSessionsCallback callback)
Request
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207public class SearchSessionsRequest {// request parameters.private String username;private String password;private String startdate;private String enddate;private String sessionid;private String amount;private String approvedamt;private String transtype;private String cardpart;private String approved;private String completed;private String cancelled;private String reverseorder;private int clientid;private int siteid;private int gateid;public SearchSessionsRequest(){// set default values.username="";password="";startdate="";enddate="";sessionid="";approved="";cardpart="";transtype="";approvedamt="";amount="";completed="";cancelled="";reverseorder="";clientid=0;siteid=0;gateid=0;}// getter and setters.public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}public String getStartdate() {return startdate;}public void setStartdate(String startdate) {this.startdate = startdate;}public String getEnddate() {return enddate;}public void setEnddate(String enddate) {this.enddate = enddate;}public String getSessionid() {return sessionid;}public void setSessionid(String sessionid) {this.sessionid = sessionid;}public String getAmount() {return amount;}public void setAmount(String amount) {this.amount = amount;}public String getApprovedamt() {return approvedamt;}public void setApprovedamt(String approvedamt) {this.approvedamt = approvedamt;}public String getTranstype() {return transtype;}public void setTranstype(String transtype) {this.transtype = transtype;}public String getCardpart() {return cardpart;}public void setCardpart(String cardpart) {this.cardpart = cardpart;}public String getApproved() {return approved;}public void setApproved(String approved) {this.approved = approved;}public String getCompleted() {return completed;}public void setCompleted(String completed) {this.completed = completed;}public String getCancelled() {return cancelled;}public void setCancelled(String cancelled) {this.cancelled = cancelled;}public String getReverseorder() {return reverseorder;}public void setReverseorder(String reverseorder) {this.reverseorder = reverseorder;}public int getClientid() {return clientid;}public void setClientid(int clientid) {this.clientid = clientid;}public int getSiteid() {return siteid;}public void setSiteid(int siteid) {this.siteid = siteid;}public int getGateid() {return gateid;}public void setGateid(int gateid) {this.gateid = gateid;}}
Reply
12345678910111213141516public class SearchSessionsReply{// response.private Sessions sessions=null;// setter and getters.public Sessions getSessions() {return sessions;}public void setSessions(Sessions sessions) {this.sessions = sessions;}}
Sample Code
123456789101112131415161718192021222324// Set the request parameter.SearchSessionsRequest request=new SearchSessionsRequest();request.getAmount();request.setSessionid("5A380D260C67BA229484AB557B41DF2CBBED3090");new SessionSearchSessions().getSearchSessions(request,new SearchSessionsCallback() {@Overridepublic void getSearchSessionsReply(SearchSessionsReply reply) {if (reply.getResponse().equals("Success"))textBox.setText("Success");elsetextBox.setText("There was a problem:\n" + reply.getResponse() +"\n Descriptin "+ reply.getDescription());}});
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.
12345678910111213141516171819202122232425262728293031323334353637<!--?xml version="1.0" encoding="utf-8" ?-->Success0OKhttps://stats.slimcd.com/wswebservices/sessions.asmx/SearchSessions0CC5E2FAFC6F503DF03AA6CA693A295071A9DC387/18/2013 9:34:42 AM13MeghansTestForm1032228226448retail test 11174SALEU2.0000TrueTrue<decline_count>0<template_flag>FalseIf 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
DOWNLOAD
EXERCISER TOOL
Remarks
- Remarks Go here
- URL
123https://stats.slimcd.com/soft/json/jsonscript.asp?service=SearchSessions
Protocols- HTTP POST
- HTTP GET
This function accepts either name/value pairs or JSON
Request
Reply
12345678910111213141516171819202122232425262728293031323334353637383940{"reply": {"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/sessions.asmx/SearchSessions","datablock": {"Sessions": {"Session": {"SessionID": "0C7622D38DA638D3D167CBB736A75A46FDC4D873","Date": "7/22/2013 1:27:57 AM","FormID": "67","FormName": "simple","ClientID": "1032","SiteID": "228226448","SiteName": "retail test 111","PriceID": "74","TransType": "SALE","first6": null,"last4": null,"Approved": "U","Amount": "10.0000","ApprovedAmt": null,"Reason": null,"GateID": null,"AuthCode": null,"AVSReply": null,"CVV2Reply": null,"Cancelled": "False","Completed": "False","processortoken": null,"decline_count": "0","template_flag": "False"}}}}}Sample Code
Remarks
- None