cTrader ProtoOAApplicationAuthReq
Authorises the application on a newly opened connection, with the client id and client secret it was registered with. An account session can be opened only on a connection where this has been done.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
This is a message of the cTrader Open API, not an HTTP endpoint. It has no method and no path: it is sent over an open TCP or WebSocket connection, as Protocol Buffers or as JSON.
The message
- Name
- ProtoOAApplicationAuthReq
- Direction
- Request, sent by the client
- Payload type
- PROTO_OA_APPLICATION_AUTH_REQ, number 2100. This number is what identifies the message on the wire.
- Answered by
Fields
| Name | Type | Description |
|---|---|---|
| payloadType | ProtoOAPayloadType | Identifies the message. Its default in the definition is PROTO_OA_APPLICATION_AUTH_REQ, which is number 2100. |
| clientIdrequired | string | The client id issued when the application was registered. |
| clientSecretrequired | string | The client secret issued when the application was registered. A credential: keep it out of source code. |
Sample
Written by this site from the payload type and fields recorded on this page. It has not been run against a terminal, a server or an account, and the values in it are placeholders. No credential is typed into it: where a field holds one, the placeholder says where it comes from. Nothing is entered on this site.
The three outer keys, clientMsgId, payloadType and payload, are the ones Spotware's page on sending and receiving JSON gives. The sample holds the message's required and repeated fields and leaves the optional ones out. help.ctrader.comchecked
{
"clientMsgId": "msg-1",
"payloadType": 2100,
"payload": {
"clientId": "<the client id, from your own environment>",
"clientSecret": "<the client secret, from your own environment>"
}
}Limits that apply at cTrader Open API
| Limit | Value | Scope | Source |
|---|---|---|---|
| Requests a second, not historical data | 50 | Per connection, requests that are not for historical data | help.ctrader.comchecked |
| Requests a second, historical data | 5 | Per connection, historical data requests only | help.ctrader.comchecked |