Syntax
BackofficeLogin (username As String, password As String)
Description
The Login operation should be called before any other operation since any requested operation has to be authenticated.
Request Parameters
Name |
Description |
Required |
Username |
- The username of the dealer.
- Type: String
- Default: None
|
Yes |
Password |
- The Password of the dealer.
- Type: String
- Default: None
|
Yes |
Response Elements
Name |
Description |
Result |
This operation returns a Composite JSON object of type LoginInfo. In case of success. The following are the Login Info’s Data member:
- Sessionid : Session ID
- VersionInfo: Array which contain :
1- Rel: Release number 2- Ver: Version number 3- Patch: Patch number 4- ForceUpdate 5- UpdateType 6- Globals
- SystemLockInfo, Which contain :
1- MinutesRemaining 2- HoursRemaining 3- DaysRemaining 4- Maintanance 5- WillBeLocked
- FirstWhiteLabel: First White label name
- WLID: white label ID
- CheckWhiteLabel: If the value = true, then the logged in client is white label
- Password: Client logged in password
- Username: Client logged in username
- LastTickTime: Last tick time value
- SelectedAccount: Selected Account number
- SelectedAccountObject
- Name: selected account name.
- GWSessionID: Getaway session ID
- IP: IP address
- SessionDateStart: Session date Start
- CompanyName: Company name
- UserType:
If the value = 1 then the user type is DealerUser If the value = 2 then the user type is ClientUser If the value = 3 then the user type is DemoClientUser
- UserId: If the value < 0 then, see error code to get Error description
- DemoClient :
If the value = 0, then the Client type is a real Client. If the value =1, then the client type is a demo Client
- FName: First name
- SName: Second Name
- TName: Third Name
- LName: Last Name
- Sms: Enable SMS , if its value = 1 then the SMS is Enabled
- IsReadOnly: If its value = 1 then the client is read only
- AlertSms: Enable Alert by SMS , if its value = 1 then it is Enabled
- GMTOffset: GMT Offset value.
- SvrGMT : Server GMT value
- ClientType:
If the value = 0 then client type is Dealer If the value = 1 then Client Type is Client If the value = 2 then client type is OFFICE If the value = 3 then client type is Group
- EnableNews: If its value = 1 then the news is Enabled
- PublicSlideNews: Public news value
- PrivateSlideNews: private news value
- CommCalcType: Commission calculation type
If value = 1 then commCalcType is OPEN_TYPE If value = 2 then commCalcType is CLOSE_TYPE
- DealerTreePriv: Dealer tree privilege.
In case of login failure, please refer to the error code.
Type: JSON Object as LoginInfo
|
Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>BackofficeLogin</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script >
$(document).ready(function () {
var urlStr = "http://173.249.35.43/webtrader/webservice.svc";
jQuery.support.cors = true;
$("#progress").ajaxStart(function () { $(this).css("display", "block"); });
$("#progress").ajaxComplete(function () { $(this).css("display", "none"); });
function onSuccessResult(response) {
response = eval('(' + response + ')')
if (response.UserId == -1 || response.UserId == -207) {
$("#resultData").html("Invalid username or password");
}
else if (response.UserId == -231) {
$("#resultData").html("You must have at least one account");
}
else if (response == null || response == "" || response.UserId < 0) {
$("#resultData").html("Error while login.Please try later");
}
else {
var resultStr = "SuccessResult ... UserId is :" + response.UserId + "<br/>";
resultStr += "DemoClient :" + response.DemoClient +"<br/>"
resultStr += "IsReadOnly :" + response.isReadOnly + "<br/>"
resultStr += "First Name :" + response.FName + "<br/>"
resultStr += "Username:" + response.Username + "<br/>"
resultStr += "Password:" + response.Password + "<br/>"
resultStr += "DealerTreePriv:" + response.DealerTreePriv + "<br/>"
resultStr += "SelectedAccount:" + response.SelectedAccount + "<br/>"
$("#resultData").html(resultStr);
}
}
$("#btnLogin").click(function () {
$.getJSON(urlStr + "/BackofficeLogin?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?", onSuccessResult);
});
});
</script>
<body >
<table border="1px">
<tbody>
<tr>
<td>
Username: <input type="text" id="txtusername" value=""/>
Password: <input type="text" id="txtpassword" value=""/>
<button id="btnLogin"> Login </button>
</td>
</tr>
</tbody>
</table>
<div id="resultData"> </div>
<div id="resultAction"> </div>
<div style="display:none" id="progress">Loading ... </div>
</body>
</html>
See Also
VertexFX Backoffice WCF Service Index
|