GetUserClients
- Method
SlimCD.Login.GetUserClients
Purpose
List all clients in the system for the specified username/password.
Description
Generates a list of all accessible client ids and the name of the client. The list represents client ids available for a particular username/password in the user hierarchy.Business Rules
Argument List
Name Required Usage GetUserClientsRequest 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
GetUserClients Request Fields
Field Name Type Length Required Description Username string 20 require Username or API Access Credential that accesses web service. Password string 20 require Plaintext password for the client account. 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 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
- ClientList
- Client
- ClientID
- Company
- Client
- ClientList
Remarks
- General
- Names in name/value pairs are NOT case-sensitive
- Names inside XML tags ARE case-sensitive
- Function-Specific
- None
- reply
- Include
012<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script>
Method
12345function GetUserClients(request,callback)function GetUserClients(request,timeout,callback)
Request
123456request= {"username": "1032","password": "289075"}
Reply
123456789101112131415161718callback ( {"reply":{"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/login.asmx/GetUserClients","datablock": {"ClientList": {"Client": {"ClientID": "1032","Company": "RETAIL TEST ACCOUNT"}}}} );;
Sample Code
1234567891011121314151617<script src="https://trans.slimcd.com/soft/json/slimcd.js"></script><script>// <![CDATA[SlimCD.Login.GetUserClients({"username": "1032","password": "289075"},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 Login_GetUserClients(Login_GetUserClientsRequest $request,$timeout=false)Request
123456789class Login_GetUserClientsRequest{// property declarationpublic $username = '';public $password = '';}JSON Reply
123456789101112131415{"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/login.asmx/GetUserClients","datablock": {"ClientList": {"Client": {"ClientID": "1032","Company": "RETAIL TEST ACCOUNT"}}}Sample Code
123456789101112131415161718include 'slimcd.php';// Create the Slim CD object$SlimCD = new SlimCD() ;// Create a GetUserClientsRequest class$request = new Login_GetUserClientsRequest() ;$request->username = 1032;$request->password = 289075;$result = $SlimCD->Login_GetUserClients($request);if ($result->response == 'Success') {echo 'Success!' ;}else {echo $result->response . ':' . $result->description ;}Downloads
Download full sample source. - Include
123using SlimCD;
Method
123Public GetUserClientsReply GetUserClients(GetUserClientsRequest request,int timeout);
Request
1234567public class GetUserClientsRequest{public string username { get; set; }public string password { get; set; }}
Reply
123456789101112public class GetUserClientsReply{public string response;public string responsecode;public string description;public string responseurl;public string clientlist;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
1234567891011121314151617181920SlimCD.Login login = new SlimCD.Login();login.debug = true;login.transURL = TransURL;login.statsURL = StatsURL;GetUserClientsRequest request = new GetUserClientsRequest();GetUserClientsReply reply = new GetUserClientsReply();request.username = 1032;request.password = 289075;reply = login.GetUserClients(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 GetUserClients(GetUserClientsRequest request,int timeout);
Request
1234567public class GetUserClientsRequest{public string username { get; set; }public string password { get; set; }}
Reply
12345678910111213public class GetSessionFieldsReplypublic class GetUserClientsReply{public string response;public string responsecode;public string description;public string responseurl;public string clientlist;public string senddata;public string recvdata;}
Cross Reference: ClientSample Code
12345678910111213141516171819SlimCD.Login login = new SlimCD.Login();login.debug = true;login.transURL = TransURL;login.statsURL = StatsURL;GetUserClientsRequest request = new GetUserClientsRequest();GetUserClientsReply reply = new GetUserClientsReply();request.username = 1032;request.password = 289075;reply = await login.GetUserClients(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 (^LoginGetUserClientsReplyBlock)(LoginGetUserClientsReply *reply);- (void) loginGetUserClientsWithRequest:(LoginGetUserClientsRequest*)request replyBlock:(LoginGetUserClientsReplyBlock)replyBlock;- (void) loginGetUserClientsWithRequest:(LoginGetUserClientsRequest*)request timeout:(NSTimeInterval)timeout replyBlock:(LoginGetUserClientsReplyBlock)replyBlock;
Request
12345678@interface LoginGetUserClientsRequest@property (strong) NSString *userName;@property (strong) NSString *password;@end
Reply
12345678@interface LoginGetUserClientsReply : SlimCDReply// Array of LoginGetUserClient objects.@property (strong) NSArray *clients;@endSample Code
1234567891011121314151617SlimCD *api = [[SlimCD alloc] init];LoginGetUserClientsRequest *request = [[LoginGetUserClientsRequest alloc] init];request.userName = @"1032";request.password = @"289075";[api loginGetUserClientsWithRequest:request replyBlock:^(LoginGetUserClientsReply *reply){if ( reply.responseCode == RC_SUCCESS ){NSLog(@"Retrieved user clients successfully.");}else{NSLog(@"Unable to retreive user clients");}}]; - Method
1234567public void getUserClients(GetUserClientsRequest loginUserClientRequest,int timeout,GetUserClientsCallback callback)public void getUserClients( GetUserClientsRequest loginUserClientRequest,GetUserClientsCallback callback)
Request
123456789101112131415161718192021222324252627public class GetUserClientsRequest {private String username;private String password;public GetUserClientsRequest(){// set the default value.username="";password="";}// setters and getters.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;}}Reply
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657public class GetUserClientsReply {private String response="";private String responsecode="";private String description="";private String responseurl="";private Datablock datablock = null;private String sentdata="";private String recvdata="";// setters and getters.public String getSentdata() {return sentdata;}public void setSentdata(String sentdata) {this.sentdata = sentdata;}public String getRecvdata() {return recvdata;}public void setRecvdata(String recvdata) {this.recvdata = recvdata;}public String getResponse() {return response;}public void setResponse(String response) {this.response = response;}public String getResponsecode() {return responsecode;}public void setResponsecode(String responsecode) {this.responsecode = responsecode;}public String getDescription() {return description;}public void setDescription(String description) {this.description = description;}public String getResponseurl() {return responseurl;}public void setResponseurl(String responseurl) {this.responseurl = responseurl;}public Datablock getDatablock() {return datablock;}public void setDatablock( Datablock datablock) {this.datablock = datablock;}}Sample Code
1234567891011121314151617181920212223// set the request parameter.GetUserClientsRequest request=new GetUserClientsRequest();request.setUsername("1032");request.setPassword("289075");// To make web service request.new LoginGetUserClients().getUserClients(request,new GetUserClientsCallback() {@Overridepublic void getUserClientsReply(GetUserClientsReply 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.
123456789101112131415<!--?xml version="1.0" encoding="utf-8" ?-->Success0OKhttps://stats.slimcd.com/wswebservices/login.asmx/GetUserClients1032RETAIL TEST ACCOUNTIf 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=GetUserClients
Protocols- HTTP POST
- HTTP GET
This function accepts either name/value pairs or JSON
Request
Reply
1234567891011121314151617{"reply": {"response": "Success","responsecode": "0","description": "OK","responseurl": "http://stats.slimcd.com/wswebservices/login.asmx/GetUserClients","datablock": {"ClientList": {"Client": {"ClientID": "1032","Company": "RETAIL TEST ACCOUNT"}}}}Sample Code
Remarks
- None