USERS

Adding users to the market center

After login, the following trading APIs functions are available to the client.

  • “adduser

  • “deposit”

  • “withdraw”

  • “querydeposit”

  • “querytrade”

  • “logout”

  • “getsymbols”

  • “addorder”

  • “cancelorder”

MESSAGE UPDATES FROM FI TO CLIENTS

FI will send current open orders and position info to the client upon login. If client places a new order, FI will send client an order update automatically. If there is trade, client will receive a trade update and corresponding position updates.

ADD USERS

Administrator account can use this command to add additional users. Ordinary user can use this command to update password.

The "userid" is what a user uses to login, but alongside that id you can separately set a "complianceid" also known as a "traderid". If the "complianceid" is not set it will default to be the "userid".

Here is a request sample, again “pass” field needs to be encrypted using pubic key from challenge response.

SAMPLE REQUEST ADD USERS

{“type”:”adduser”,”userid”:”testuser@gmail.com”,”pass”:”SZ7DMkMnU5qBszWkABPHsUjkPKol
cmWXbSdaydjsMOJG/CnujgQhm4vRWWr6BQmH9SsU7fFeheGYatTIL+n0yC+C0TqaOipSpC7rDSa
pveEsqHJTPgXYXeOb34wj76IHdv44UwT2Vr9Db+t6Q0K1j
wITy7/CxOqpYRea5g7Zt7A=”}

SAMPLE RESPONSES SUCCESS OR FAILURE

{“result”:”password
issue”,”userid”:”testuser@gmail.com”,”type”:”adduser”,”pass”:”SZ7DMkMnU5qBszWkABPHsUjk
PKolcmWXbSdaydjsMOJG/CnujgQhm4vRWWr6BQmH9SsU7fFeheGYatTIL+n0yC+C0TqaOipSpC
7rDSapveEsqHJTPgXYXeOb34wj76IHdv44UwT2Vr9Db+t6Q0K1j
wITy7/CxOqpYRea5g7Zt7A=”}

{“result”:”OK”,”userid”:”testuser@gmail.com”,”type”:”adduser”,”pass”:”ay5bjq6rONPIjDoEwHd
y6TZQzyzdcivSJQ6ReNdmAEQofuTC5WYnl1i5Qf7SA5c7owpN6IaODZkyb+WAN/gFylHzcSrmSme
DX9ZsuR/1AOEOeqCjlkgfEuLoaLdItYGcxOQoCDJwOl9sN81SbYxlurqq10ZLk53B9W+gAcwamZY=”
}

This "attr" property is an object which can contain any number of keys within it. In this "attr" property you can store any user data that you need - such as address, name, email and etc.

Updating user data with the "adduser" message.

  • “adduser” command can be used for both adding user and updating user profile.

  • "updateprof”, true:false, if you set it to true, this is to update existing user profile.

Superuser can update fields such as “active”, password… any field. Ordinary user can update his own password and should be allowed to update “attr” field also. (This way, user’s own preference can be saved by user directly, that is why account management items should be outside “attr” field)

Below is an example of updating "active", you need to set “active” besides setting “updateprof” to true.

REQUEST TO SET ACTIVE

 {"type":"adduser","updateprof":true, active:"Y",userid":"what_is@gmail.com"} 

RESPONSE TO SET ACTIVE

{"result":"OK","updateprof":"true,"userid":"what_is@gmail.com","type":"adduser"}

Last updated