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

v4/summoners/by-name/ endpoint has been removed #241

Open
hingston opened this issue May 16, 2024 · 1 comment
Open

v4/summoners/by-name/ endpoint has been removed #241

hingston opened this issue May 16, 2024 · 1 comment

Comments

@hingston
Copy link
Contributor

v4/summoners/by-name/ endpoint has been removed so lol_watcher.league.by_summoner now raises the following (running the code in the readme):

Traceback (most recent call last):
  File "C:\Python\testing\.venv\Lib\site-packages\riotwatcher\Handlers\ThrowOnErrorHandler.py", line 18, in after_request
    response.raise_for_status()
  File "C:\Python\testing\.venv\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://na1.api.riotgames.com/lol/summoner/v4/summoners/by-name/pseudonym117

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python\testing\lol_watcher_test.py", line 7, in <module>
    me = lol_watcher.summoner.by_name(my_region, 'pseudonym117')
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\testing\.venv\Lib\site-packages\riotwatcher\_apis\league_of_legends\SummonerApiV4.py", line 46, in by_name
    return self._request_endpoint(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\testing\.venv\Lib\site-packages\riotwatcher\_apis\NamedEndpoint.py", line 36, in _request_endpoint
    return self._base_api.raw_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\testing\.venv\Lib\site-packages\riotwatcher\_apis\BaseApi.py", line 51, in raw_request
    mod = handler.after_request(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\testing\.venv\Lib\site-packages\riotwatcher\Handlers\ThrowOnErrorHandler.py", line 20, in after_request
    raise ApiError(*err.args, request=err.request, response=err.response)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://na1.api.riotgames.com/lol/summoner/v4/summoners/by-name/pseudonym117

It should be replaced with /riot/account/v1/accounts/by-riot-id/{gameName}/{tagLine} to get the puuid and then calling the summoner endpoint to maintain the same functionality as before.

@pseudonym117
Copy link
Owner

Replacement already available via RiotWatcher.account.by_riot_id.

Will remove old API soon.

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

2 participants