All API calls in this section concern operations with cTID entities (‘users’).
All URLs for the API calls described in this section are relative to https://HOST:PORT/cid
. The value of HOST:PORT
is provided during the onboarding process by Spotware’s service assurance team.
HTTP Method | URL |
---|---|
POST |
/ctid/create |
Creates a new user entity.
Note that this API call cannot be used for creating new cTIDs as part of our SSO (OAuth) solution. For more information, please refer to our SSO (OAuth) documentation.
Parameters
No parameters.
Request Body
Key | Required? | Data Type | Description |
---|---|---|---|
brokerName |
No | string | A unique name denoting a specific broker (including White Labels). |
email |
Yes | string | The email address assigned to the new user. |
preferredLanguage |
No | string | An Alpha-2 code denoting the preferred language of the new user. |
Output
Note that there are two possible outputs depending on whether you specify a unique
userId
parameter.
Key | Data Type | Description |
---|---|---|
userId |
integer | The unique identifier of the user entity. |
nickname |
string | The nickname of the user entity. By default, nickname=ctid{userId} . |
email |
string | The email assigned to the user entity. |
preferredLanguage |
string | An Alpha-2 code denoting the preferred language of the user entity. |
utcCreateTimestamp |
integer | The epoch unix timestamp of the creation of the user entity. |
status |
enum | The status of the new user entity. The following values are accepted."CTID_NEW" . The default status for any new user."CTID_ACTIVE" . The status denoting an existing active user who has confirmed their email address in the cTrader ecosystem. Note that only users with "CTID_ACTIVE" as their status receive trading notifications in their email inbox."CTID_DELETED" . The status denoting a deleted user entity.Note that receiving "CTID_ACTIVE" or "CTID_DELETED" in the response body would constitute unexpected behavior. |
For a JSON schema of the output, click here.
Request Example
curl -X POST 'https://HOST:PORT/cid/ctid/create?token=1dd4ef40-c5b3-61c0-0689-b1b40c97fadc' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"brokerName": "BESTBROKER", "email": "president@bestbroker.com", "preferredLanguage": "EN"}'
Response Examples
email
Is Specifiedemail
Is Specified{
"userId": 10333,
"nickname": "ctid10333",
"email": "president@bestbroker.com",
"utcCreateTimestamp": 1679898064783,
"preferredLanguage": "en",
"status": "CTID_NEW"
}
{
"userId": 10333
}
Expected Status Code
200
HTTP Method | URL |
---|---|
POST |
/ctid/link |
Links a trader entity to a user entity.
Parameters
No parameters.
Request Body
Key | Required? | Data Type | Description |
---|---|---|---|
traderLogin |
Yes | integer | The number of a specific trading account. This is functionally the same parameter as login as detailed in API call 4.1 and related calls. |
traderPasswordHash |
Yes | string | The MD5 of the account password. |
userId |
Yes | integer | The unique identifier of a user entity. |
brokerName |
Yes | string | A unique name denoting a specific broker (including White Labels). |
environmentName |
Yes | string | A unique name of a specific trading environment where the specified traderLogin is registered. |
returnAccountDetails |
No | boolean | A flag that denotes whether the ctidTraderAccountId key is returned in the response to this API call. Set it to true to ensure that the response to this call is not empty. |
Output
Key | Data Type | Description |
---|---|---|
ctidTraderAccountId |
integer | The unique identifier 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=1dd4ef40-c5b3-61c0-0689-b1b40c97fadc' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"environmentName": "demo", "brokerName": "BESTBROKER", "traderLogin": 9017800, "traderPasswordHash": "0f94e246908667af85916300c57f74b6", "userId": 10333, "returnAccountDetails": true}'
Response Example
{
"ctidTraderAccountId": 8673590
}
Expected Status Code
200
HTTP Method | URL |
---|---|
POST |
/ctid/changeCtidTraderAccount |
Changes the White Label (brokerage/jurisdiction) under which a specific trader is registered.
Parameters
No parameters.
Request Body
Key | Required? | Data Type | Description |
---|---|---|---|
brokerName |
Yes | string | A unique name denoting the new broker to which the trader should be attributed. |
traderLogin |
Yes | integer | The number of the trading account that you would like to transfer to a different broker. This is functionally the same parameter as login as detailed in API call 4.1 and related calls. |
environmentName |
Yes | string | A unique name of a specific trading environment. |
Output
No output.
Request Example
curl -X POST 'https://HOST:PORT/cid/ctid/changeCtidTraderAccount?token=1dd4ef40-c5b3-61c0-0689-b1b40c97fadc' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"environmentName": "demo", "brokerName": "BESTBROKER", "traderLogin": 9017800}'
Response Example
This API call does not produce an output.
Expected Status Code
200