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

Get user who owns bearer token with Helix API #8

Open
alexf91 opened this issue Aug 29, 2019 · 1 comment
Open

Get user who owns bearer token with Helix API #8

alexf91 opened this issue Aug 29, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@alexf91
Copy link

alexf91 commented Aug 29, 2019

The Twitch API returns the user who owns the bearer token when no arguments are provided to https://api.twitch.tv/helix/users.

If neither a user ID nor a login name is specified, the user is looked up by Bearer token.
https://dev.twitch.tv/docs/api/reference/#get-users

This is currently not possible, because of this check:

if len(params['id'] + params['login']):

To keep the API consistent, this behavior should probably only be added for Helix.user() and not to Helix.users(). This way there is no confusion when an empty user list is requested. Otherwise, an empty user list could return a non-empty result.

I have implemented it here, but it seems a bit hacky:
master...alexf91:current_user

@alexf91 alexf91 changed the title Get the user who owns the bearer token with the Helix API Get user who owns bearer token with Helix API Aug 29, 2019
@PetterKraabol PetterKraabol added the enhancement New feature or request label Aug 30, 2019
@lebedynskyi
Copy link

Seems no progress here..

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

No branches or pull requests

3 participants