getting started with OpenAPI through gRPC

Created at 19 Jun 2022, 19:50
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
VA

vadakoff

Joined 26.05.2022

getting started with OpenAPI through gRPC
19 Jun 2022, 19:50


Hello Everybody!

I want to understand how to works mechanism of OpenAPI between client and server use gRPC protocol.

i trying to interact with server but he's return 0 bytes. Maybe i form wrong requests?

server always returns: b''.


@vadakoff
Replies

vadakoff
19 Jun 2022, 21:27 ( Updated at: 21 Dec 2023, 09:22 )

RE:

well if will be more exacly:

if following from this documentations https://spotware.github.io/open-api-docs/protocol-buffers/

 

 


@vadakoff

amusleh
20 Jun 2022, 09:56 ( Updated at: 20 Jun 2022, 09:58 )

Hi,

The first request you send to server should be application authentication request not account auth request.

You can find the guide at: Connection - cTrader Open API

For sending and receiving data read: Sending/Receiving - cTrader Open API

For Python specific guide check the comments section at Sending / Receiving Messages tutorial page.

And it's not gRPC, it's just plain direct TCP client connection.


@amusleh

vadakoff
20 Jun 2022, 13:12

RE:

amusleh said:

Hi,

The first request you send to server should be application authentication request not account auth request.

You can find the guide at: Connection - cTrader Open API

For sending and receiving data read: Sending/Receiving - cTrader Open API

For Python specific guide check the comments section at Sending / Receiving Messages tutorial page.

And it's not gRPC, it's just plain direct TCP client connection.

Ok, seem i understood, i need ProtoOAApplicationAuthReq to auth my application, firstly


@vadakoff

vadakoff
25 Jun 2022, 14:24

I used ProtoOAApplicationAuthReq with arguments are clientId and clientSecret, these credentials are used to login in ctrader account.

But i got ProtoOAErrorRes

errorCode: "CH_CLIENT_AUTH_FAILURE"
description: "clientId or clientSecret is incorrect"

May i authorized my application with access_token where i got in tab Applications?


@vadakoff

vadakoff
25 Jun 2022, 15:00

RE:

vadakoff said:

I used ProtoOAApplicationAuthReq with arguments are clientId and clientSecret, these credentials are used to login in ctrader account.

But i got ProtoOAErrorRes

errorCode: "CH_CLIENT_AUTH_FAILURE"
description: "clientId or clientSecret is incorrect"

May i authorized my application with access_token where i got in tab Applications?

Ok i found it openapi.ctrader.com > Applications > View (button on column credentials)


@vadakoff