3.4. Link a Trading Account to a User

Method URL
POST /ctid/link

Links an existing trading account to a previously created user.

Request Body

Key Required? Data Type Description
traderLogin Yes integer The number of a specific trading account. Please, refer to the login key in API call 3.3.
traderPasswordHash Yes string The MD5 of the account password.
userId Yes integer The unique ID of a specific user.
brokerName Yes string Please, see Section 2.3.
environmentName Yes string The name of the current server environment (live or demo).
returnAccountDetails Yes boolean A flag determining whether the ctidTraderAccountId key is returned in the response to this request. Set it to true to ensure that the response to this API call is not empty.

Output

Key Data Type Description
ctidTraderAccountId integer The unique ID of the linkage between a specific user and one of their trading accounts.

Request Example

curl -X POST 'https://HOST:PORT/cid/ctid/link?token=04d95575-c9af-42fba72e-2f0ce93f01d4’ --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"environmentName": "demo", "brokerName": "BESTBROKER", "traderLogin": 8673590, "traderPasswordHash": "c5678ghf94578ce06iqrs5ag76a62c5ca4", "userId": 10345533, "returnAccountDetails": true}'

Expected Response Status Code

201

Response Example

{
    "ctidTraderAccountId": 9017800
}

Please, remember that the response body will be empty if returnAccountDetails key equals false.


Last update: September 26, 2022

Comments