• Home
  • Knowledgebase
  • Blog
  • My Account
  • Try VertexFX
  • Home
  • Knowledgebase
  • Blog
  • My Account
  • Try VertexFX

VertexFX Client WCF Service

home/Knowledge Base/Technical Support/API/Client API's/VTL/VertexFX Client WCF Service./VertexFX Client WCF Service/GetClient

GetClient

34 views 0 hybrid-solutions

Syntax

GetClient()

Description

The GetClient operation is used toreturn all clients data needed including accounts list and child clients list,
needed to build your clients tree after logging on.

Request Parameters

This operation takes no parameters.

Response Elements

Name Description
Result

In case of success, this operation returns an object of type Client that holds the following members:

  • Accounts:Indicates to the accounts related to the client.
    -AccountID.
    -AccountType: As the following:
     0: Which means Demo Account Type.
     1: Which means Normal Account Type.
     2: Which means Coverage Account Type.
    -IsMargin.
    -DemoAccount.
    -LockLiquidate.
  • ChildClients:Indicates to child related to Client.
  • ClientID: Indicates to Client ID.
  • ClientType: Indicates to the Client Type as the following:
    1: Which means Client type.
    2: Which means office type.
    3: Which means group type.
  • FirstName: Indicates to client first name.
  • FullName:Indicates to client full name.
  • LastName: Indicates to client last name.
  • ThirdName: Indicates to client third name.
  • UserName:Indicates to user name.
  • Parent: Client parent.
  • Phone: Indicates to client Phone.
  • Email: Indicates to client Email.
  • Address: Indicates to client address.
  • Country:Indicates to client country.
  • Password: Indicates the client Password.
  • ClientID: Indicates the logged in client ID.
  • EnableInterest: Indicates if the interest enabled or not.
  • LiqPoint: Indicates the liquidation point value.
  • LiqType:Indicates the liquidation type.
    1: Which means the liquidation at the Equity value.
    2: Which means the liquidation at the Margin level value.
  • ComCalcType : Indicates the commission calculation type.
    1: means on open
    2: means on close

Otherwise see Error codes.
Type: JSON object as client.

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>GetClient</title><script src="http://code.jquery.com/jquery-latest.js"></script></head><script >$(document).ready(function () {var urlStr = "http://webtrader.hybridsolutions.com/publicweb/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 failed : ' + result.status + ' ' + result.statusText);}$("#btnLogin").click(function () {$.getJSON(urlStr + "/Login?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?", onSuccessResult);});$("#btnAction").click(function () {$.getJSON(urlStr + "/GetClient?" + "callback=?", onSuccessResult);function onSuccessResult(dataResult) {dataResult = eval('(' + dataResult + ')');var acc = "";if (dataResult.ClientID > 0) {var clientType = "client";var AccountType = "Demo";var liqType = "margin";if (dataResult.ClientType == 1) { clientType = "Client"; acc += "Client Type: Client " }else if (dataResult.ClientType == 2) { clientType = "office"; acc += "Client Type: office " }else { clientType = "group"; acc += "Client Type: group " }acc += "<li align='left'> First name: " + dataResult.FirstName + "</li>";acc += "<li align='left'> Enable Interest: " + dataResult.EnableInterest + "</li>";acc += "<li align='left'> liquidation Point: " + dataResult.LiqPoint + "</li>";acc += "<li align='left'> Client ID: " + dataResult.ClientID + "</li>";if (dataResult.LiqType == 1 ) {liqType = " Equity ";}else {liqType = "Margin level ";}acc += "<li align='left'> Liquidate Type: " + liqType + "</li>";for (var i = 0; i < dataResult.Accounts.length; i++) {acc += "<li>Account Id :" + dataResult.Accounts[i].AccountID + "</a></li>";if (dataResult.Accounts[i].AccountType = 0 ){AccountType = "Demo Account ";}else if (dataResult.Accounts[i].AccountType = 1){AccountType = "Normal account ";}else {AccountType = "Coverage account ";}acc += "<li>Account Type : " + AccountType + "</a></li>";acc += "<li>Is Margin : " + dataResult.Accounts[i].IsMargin + "</a></li>";acc += "<li>Demo Account : " + dataResult.Accounts[i].DemoAccount + "</a></li>";acc += "<li>Lock Liquidate : " + dataResult.Accounts[i].LockLiquidate + "</a></li>"; }if (dataResult.ChildClients) {acc += "ChildClients are :";for (var x = 0; x < dataResult.ChildClients.length; x++) {for (var i = 0; i < dataResult.ChildClients[x].Accounts.length; i++) {acc += "<br>";acc += "<br>";acc += "<li>Account Id :" + dataResult.ChildClients[x].Accounts[i].AccountID + "</a></li>";if (dataResult.ChildClients[x].Accounts[i].AccountType = 0 ){AccountType = "Demo Account ";}else if (dataResult.ChildClients[x].Accounts[i].AccountType = 1){AccountType = "Normal account ";}else {AccountType = "Coverage account ";}acc += "<li>Account Type : " + AccountType + "</a></li>";acc += "<li>Is Margin : " + dataResult.ChildClients[x].Accounts[i].IsMargin + "</a></li>";acc += "<li>Demo Account : " + dataResult.ChildClients[x].Accounts[i].DemoAccount + "</a></li>";acc += "<li>Lock Liquidate : " + dataResult.ChildClients[x].Accounts[i].LockLiquidate + "</a></li>"; }}}acc += "</ul></li>";$("#resultAction").html(acc);}}});});</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><button id="btnAction"> GetClient </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

  • GetGlobals
  • Logout
  • DeliverSymbol


VertexFX WCF Service Index

Was this helpful?

Yes  No
Leave A Comment Cancel reply

  GetAlerts

CloseOrder  

About
VertexFX Trader has a closed-loop trading structure with BackOffice dealing desk, Client Terminals, Dedicated Hosting, White Labelling and Bridging Capabilities. Through VertexFX Risk Management Bridge...
Categories
  • Release Notes
  • Technical Support
  • VertexFX Pro Setup
  • Mobile Trader
  • Lite VertexFX Mobile Trader
Community
  • Blog
  • Media Center
Need Support?
If you need any further help, don't hesitate to send a support request to our support team.
Contact Support
  • Privacy Policy
  • Brokers Terms
  • Traders EULA
  • ISV Terms
  • Plugins EULA
  • Copyright 2024 hybridsolutions.com. All Rights Reserved.