Forexience 0 Report post Posted October 2, 2020 Hello, Based on the GainCapital Authentication API documention I am trying to test the Logon API with Python which I'm expecting to receive ApiLogOnResponseDTO however, I am getting the 400 HTTP response. Just to troubleshoot this issue I used Postman to see if I get the same error but it appears everything works just fine. Please see the attached screenshot. Here is my Python code. import requests url = 'https://ciapi.cityindex.com/TradingAPI/session' login_request_body = {'Password': 'xxxxxxxxxx', 'UserName': 'xxxxxxxxxx', 'AppKey': 'xxxxxxxxx' } login_response = requests.post(url, data = login_request_body) and here is the response I get PS C:\Code> python3.8.exe .\authapi.py <Response [400]> That being said I would like to know if there is any documentation that can provide us the sample codes in Python. I have seen such documentation for other Forex brokers such as OANDA . Share this post Link to post
Forexience 0 Report post Posted October 5, 2020 Hello, Is there any update on this topic? Share this post Link to post
Physicsman 25 Report post Posted October 7, 2020 Hello, We do not have an official Python library to use with the API and we cannot troubleshoot Python coding. Another user in the past was working with the API with Python and very kindly shared their unofficial library on the forum: The library might be helpful to get you started. Kind Regards, PM Share this post Link to post