Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The access token being passed has expired or is invalid #148

Closed
tej-rapolu opened this issue Jan 27, 2021 · 1 comment
Closed

The access token being passed has expired or is invalid #148

tej-rapolu opened this issue Jan 27, 2021 · 1 comment

Comments

@tej-rapolu
Copy link

Hi @areed1192,

Firstly, Thank you so much for creating this library and giving people like me a head start. While i was testing my script that's using this library, i often run into issues even after updating this to 0.3.2 as per #131.

I'm initializing the client just as recommended with json file path. Is there anything that i'm doing incorrectly? Appreciate your help on this.

Error 1:

td.exceptions.TknExpError: { "error":"The access token being passed has expired or is invalid."

Error 1- Trace
File "C:\Users\tejka\AppData\Local\Programs\Python\Python38\lib\site-packages\td\client.py", line 1847, in place_order
return self._make_request(method='post', endpoint=endpoint, mode='json', json=order, order_details=True)
File "C:\Users\tejka\AppData\Local\Programs\Python\Python38\lib\site-packages\td\client.py", line 581, in _make_request
raise TknExpError(message=response.text)
td.exceptions.TknExpError:
{
"error":"The access token being passed has expired or is invalid."

Error 2:

td.exceptions.NotNulError: { "error" : "invalid_request"

Error 2 - Trace:
File "C:\Users\tejka\AppData\Local\Programs\Python\Python38\lib\site-packages\td\client.py", line 1847, in place_order
return self._make_request(method='post', endpoint=endpoint, mode='json', json=order, order_details=True)
File "C:\Users\tejka\AppData\Local\Programs\Python\Python38\lib\site-packages\td\client.py", line 524, in _make_request
self._token_validation()
File "C:\Users\tejka\AppData\Local\Programs\Python\Python38\lib\site-packages\td\client.py", line 487, in _token_validation
self.grab_refresh_token()
File "C:\Users\tejka\AppData\Local\Programs\Python\Python38\lib\site-packages\td\client.py", line 358, in grab_refresh_token
token_response = self._make_request(
File "C:\Users\tejka\AppData\Local\Programs\Python\Python38\lib\site-packages\td\client.py", line 579, in _make_request
raise NotNulError(message=response.text)
td.exceptions.NotNulError: {
"error" : "invalid_request"

@switchingbits
Copy link

Im getting the same exact thing. Even when I try it at the developer API page: https://developer.tdameritrade.com/account-access/apis/post/accounts/%7BaccountId%7D/orders-0

"The access token being passed has expired or is invalid."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants