jmfernandes / robin_stocks

This is a library to use with Robinhood Financial App. It currently supports trading crypto-currencies, options, and stocks. In addition, it can be used to get real time ticker information, assess the performance of your portfolio, and can also get tax documents, total dividends paid, and more. More info at
http://www.robin-stocks.com
MIT License
1.74k stars 468 forks source link

400 Client Error: Bad Request for url: https://api.robinhood.com/oauth2/token/ #25

Closed diegovargasf closed 5 years ago

diegovargasf commented 5 years ago

I have encountered this issue today:

 token = 'Bearer {}'.format(data['access_token'])
TypeError: 'NoneType' object is not subscriptable

I have done some digging and it looks like the issue is happening in this line in authetication.py: data = helper.request_post(url,payload)

The error that I'm seeing is: data = helper.request_post(url,payload)

this is the redacted payload, note that the password and username are working correctly in the robinhood app.

challenge_type:sms
client_id:xxx
device_token:b34e3cf0-c549-8cef-2722-4f662bb12d96
expires_in:86400
grant_type:password
password:xxx
scope:internal
username:diego.vargas.frontanilla@xxx

I've seen this error before but it usually went away after restarting my python interpreter, however today, it is just not going away. I have even tried re installing robin_stocks.

dirigible37 commented 5 years ago

Although I don't have 2FA setup, it seems I get a text message with a 6 digit code when I call .login() and receive this 400 error. So I am assuming it's something having to do with that.

ekoshelev commented 5 years ago

Also having the same issue, haven't been able to find a solution.

shubhamgandhi commented 5 years ago

Same issue here. Something seems to have changed on Robinhood's end?

shubhamgandhi commented 5 years ago

Although I don't have 2FA setup, it seems I get a text message with a 6 digit code when I call .login() and receive this 400 error. So I am assuming it's something having to do with that.

Yep, I got the same thing.

fanliangdong commented 5 years ago

Having the same issue, not sure what is going on, any solutions?

celmore25 commented 5 years ago

Same problem. Does anyone know what the "res.raise_for_status()" line is doing inside of help.request_port? That is where I am getting my error message.

Scr44gr commented 5 years ago

The problem is that the verification code that is sent via sms you can not put it in code, there is no method for that, I will write one and make a pull requests as soon as possible to solve this.

Jmarkaba commented 5 years ago

Please see my comment on #24

jmfernandes commented 5 years ago

closing. see issue #24