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

Unexpected 403 response from API when attempting to list devices #19

Open
boydthomson opened this issue Mar 6, 2018 · 1 comment
Open

Comments

@boydthomson
Copy link

Installed using pip install somecomfort. Will try cloning and running from source to see if I can get more details.

:~$ somecomfort --devices
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): www.mytotalconnectcomfort.com
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal HTTP/1.1" 200 4142
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "POST /portal?RememberMe=false&timeOffset=480 HTTP/1.1" 200 4270
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?RememberMe=false&timeOffset=480 HTTP/1.1" 200 4180
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "GET /portal?RememberMe=false&timeOffset=480 HTTP/1.1" 200 4180
INFO:somecomfort:Session refreshed
DEBUG:urllib3.connectionpool:https://www.mytotalconnectcomfort.com:443 "POST /portal/Location/GetLocationListData?filter=&page=1 HTTP/1.1" 403 1233
ERROR:somecomfort:API returned 403 from /Location/GetLocationListData request
Traceback (most recent call last):
File "/home/boyd/bin/somecomfort", line 11, in
sys.exit(main())
File "/home/boyd/.local/lib/python2.7/site-packages/somecomfort/main.py", line 201, in main
_main(session)
File "/home/boyd/.local/lib/python2.7/site-packages/somecomfort/main.py", line 156, in _main
session=session)
File "/home/boyd/.local/lib/python2.7/site-packages/somecomfort/client.py", line 385, in init
self._discover()
File "/home/boyd/.local/lib/python2.7/site-packages/somecomfort/client.py", line 49, in wrapper
return fn(*args, **kwargs)
File "/home/boyd/.local/lib/python2.7/site-packages/somecomfort/client.py", line 500, in _discover
raw_locations = self._get_locations()
File "/home/boyd/.local/lib/python2.7/site-packages/somecomfort/client.py", line 463, in _get_locations
return self._post_json(url, params=params)
File "/home/boyd/.local/lib/python2.7/site-packages/somecomfort/client.py", line 447, in _post_json
return self._request_json('post', *args, **kwargs)
File "/home/boyd/.local/lib/python2.7/site-packages/somecomfort/client.py", line 441, in _request_json
resp.status_code))
somecomfort.client.APIError: Unexpected 403 response from API

@boydthomson
Copy link
Author

ran pip uninstall somecomfort and then pip3 install somecomfort and I no longer get the "Unexpected 403 response".

However, I get "somecomfort.client.APIRateLimited: You are being rate-limited. Try waiting a bit." just from requesting device list. I've tried waiting 10 minutes and I still get this error. I've cloned the repo but I'm not an overly experienced python developer and I'm not sure where to begin looking for ways to reduce the rate of API requests.

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

1 participant