Closed NoturBusiness closed 6 months ago
Hi there,
have you check if it's not an issue with the one_time_password
?
For instance by temporarly disabling 2FA.
Also to avoid having to manually set this field there is totp_secret_key
parameter: see the documentation for information on this.
I came across this issue and seem to have fixed it. When using the trading API you need to provide the int_account
to the Credentials
as well.
So it looks like this:
# SETUP CREDENTIALS
int_account = config_dict.get("int_account")
username = config_dict.get("username")
password = config_dict.get("password")
credentials = Credentials(
int_account=int_account,
username=username,
password=password,
)
Closing this issue.
Feel free to open a new issue if you have more information about it.
Thanks
403 {"errors":[{"text":"Request is forbidden"}]}
IMPORTATIONS
import json import logging from degiro_connector.trading.api import API as TradingAPI from degiro_connector.trading.models.trading_pb2 import Credentials
credentials = Credentials( username='DeGiroRobot', password='NotMyPassword!#', one_time_password=333333, )
SETUP TRADING API
trading_api = TradingAPI(credentials=credentials)
CONNECT
trading_api.connect()
FETCH DATA
account_info_table = trading_api.get_account_info()
DISPLAY DATA
account_info_pretty = json.dumps(account_info_table, sort_keys=True, indent=4) print(account_info_pretty)