ProtoOATraderReq - Trading account is not authorized

Created at 08 Apr 2025, 10:25
SO

soskrr

Joined 20.08.2023

ProtoOATraderReq - Trading account is not authorized
08 Apr 2025, 10:25


Hi I ran into some problems with OpenAPI, when I try to fetch the account data through ProtoOATraderReq, it gives an error saying “Trading account is not authorized”

The code is here, the access setting is set to `Access account and trading`, and I have access token generated in the sandbox. Please help.

Thank you

def get_account_info(self, ctidTraderAccountId):
        request = ProtoOATraderReq()
        request.ctidTraderAccountId = ctidTraderAccountId
        self.client.send(request).addCallback(lambda response: (
            print('Account info:', Protobuf.extract(response)),
        ))
Account info: ctidTraderAccountId: 42879486
errorCode: "INVALID_REQUEST"
description: "Trading account is not authorized"

@soskrr
Replies

nakw
11 Apr 2025, 21:02 ( Updated at: 14 Apr 2025, 05:18 )

you maybe need to send ProtoOAApplicationAuthReq payloadType 2100 first with clientId,clientSecret
 

server response:

{ payloadType: 2101, protoType: 'ProtoOAApplicationAuthRes' }


@nakw