Syntax
Function GetAccountByID (AccountId As long) As String
Description
The GetAccountByID operation is used to get information about the given account number.Use GetAccountsIDs to get a list of accounts ID's that belongs to a specific client.
Request Parameters
Name |
Description |
Required |
AccountId
|
- account number to get account information for
- Type : long
- Default : None
- Constraints : Must be valid account ID and accessible by logged in dealer
|
Yes
|
Response Elements
Name |
Description |
Result
|
The operation returns JSON object of type Account, otherwise, an explicit error code is returned if account ID is less than 0.
The Following are the client Information data member
- AccountID: account number
- AccountType : 1 = normal Account
2 = Coverage Account
- IsMargin: Boolean value to indicate if account is margin or not .
- DemoAccount : Indicate if account is demo or not
- LockLiquidate : Indicate if account is locked or not.
|
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>GetAccountByID</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script >
var hisTable;
$(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 {
$("#resultData").html("SuccessResult ... UserId is :" + response.UserId);
}
}
$("#resultAction").ajaxError(function (result) { $(this).html('An error occured'); });
function onErrorResult(result) {
alert('Service call faild : ' + result.status + ' ' + result.statusText);
}
$("#btnLogin").click(function () {
$.getJSON(urlStr + "/BackofficeLogin?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?" , onSuccessResult);
});
function onSuccessResultAction(dataResult) {
dataResult = eval('(' + dataResult + ')');
if (dataResult.AccountID > 0) {
var resultStr = "SuccessResult ... " + "<br/>";
resultStr += "AccountID :" + dataResult.AccountID +"<br/>"
resultStr += "AccountType :" + dataResult.AccountType + "<br/>"
resultStr += "DemoAccount :" + dataResult.DemoAccount + "<br/>"
resultStr += "IsMargin:" + dataResult.IsMargin + "<br/>"
$("#resultData").html(resultStr);
}
else {
var errDetail = https://support.hybridsolutions.com//index.php?/Knowledgebase/Article/View/4603"
$("#resultData").html("Error Code : " + dataResult + "<br/>" + " for more details see the follwing link: " + errDetail.link(errDetail));
}
}
$("#btnAction").click(function () {
$.getJSON(urlStr + "/GetAccountByID?AccountID=" + $("#ClientID").val() + "&callback=?" , onSuccessResultAction);
});
});
</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>
<tr >
<td>
AccountID: <input type="text" id="ClientID" value=""/>
<button id="btnAction"> GetAccountByID </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
|