Skip to content

Getting a 403 Client Error: Forbidden error  #89

@EricRibeiro

Description

@EricRibeiro

Hey 👋

Thank you for your work! I've been trying to use your library to interact with my Smart Lock, but I keep getting the following error:

Traceback (most recent call last):
  File "/Users/Eric/Projects/personal/august/./app.py", line 21, in <module>
    authenticator.send_verification_code()
  File "/opt/homebrew/lib/python3.11/site-packages/yalexs/authenticator.py", line 107, in send_verification_code
    self._api.send_verification_code(
  File "/opt/homebrew/lib/python3.11/site-packages/yalexs/api.py", line 55, in send_verification_code
    return self._dict_to_api(
           ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/yalexs/api.py", line 265, in _dict_to_api
    _raise_response_exceptions(response)
  File "/opt/homebrew/lib/python3.11/site-packages/yalexs/api.py", line 299, in _raise_response_exceptions
    raise err
  File "/opt/homebrew/lib/python3.11/site-packages/yalexs/api.py", line 272, in _raise_response_exceptions
    response.raise_for_status()
  File "/opt/homebrew/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api-production.august.com/validation/email

I have tried using phone instead of email, but it also returns a 403. I wonder if it is related to this or if I'm just doing something wrong. For reference, I am using the code you provided in the README:

from yalexs.api import Api 
from yalexs.authenticator import Authenticator, AuthenticationState
from yalexs.const import Brand

api = Api(timeout=20, brand=Brand.AUGUST)
authenticator = Authenticator(api, "email", "redacted", "redacted")

authentication = authenticator.authenticate()

# State can be either REQUIRES_VALIDATION, BAD_PASSWORD or AUTHENTICATED
# You'll need to call different methods to finish authentication process, see below
state = authentication.state

# If AuthenticationState is BAD_PASSWORD, that means your login_method, username and password do not match

# If AuthenticationState is AUTHENTICATED, that means you're authenticated already. If you specify "access_token_cache_file", the authentication is cached in a file. Everytime you try to authenticate again, it'll read from that file and if you're authenticated already, Authenticator won't call Yale Access again as you have a valid access_token


# If AuthenticationState is REQUIRES_VALIDATION, then you'll need to go through verification process
# send_verification_code() will send a code to either your phone or email depending on login_method
authenticator.send_verification_code()

I see the same Forbidden error if I try authenticating via HomeAssistant:

image

FWIW, I've bought my first August Smart Lock and created my account this week so my account is fairly new.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions