Skhmt / tapic

Twitch API & Chat. A javascript library for doing things with twitch chat, APIs, and pubsub. Can be used to make a HTML or Node.js bot. Or something.
MIT License
18 stars 5 forks source link

How to get permission for isSubscribing #6

Closed vagneralbino closed 7 years ago

vagneralbino commented 7 years ago

Hello, and thanks again for the fix for isFollowing. It works like a charm!

This time I think it's not an issue with the code per se, but my own ignorance. However, I can't seem to find any other way of contacting you, so apologies if I used the wrong form for this.

I can't seem to figure out how to authorize Tapic so I can use it to retrieve a list of subscribers of my channel.

I tried using https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id=CLIENT_ID&scope=channel_subscriptions

I replaced CLIENT_ID with the ID Tapic itself returns after initialization, but it seems to require a redirect_uri that I have no idea of where to find.

Could you please instruct me on what to do?

I am connected to an Affiliate account, but I believe that does not work any differently than a Partner account with regards to subscribers, is that correct?

The user and channel are the same. Whenever I use isSubscribing I get the message "UNAUTHORIZED."

Thank you!

Skhmt commented 7 years ago

The scope you need is "channel_check_subscription" according to: https://dev.twitch.tv/docs/v5/reference/channels/#check-channel-subscription-by-user

I put that in the docs and comments in the code too.

As for getting an oauth, the official docs page on that topic is pretty helpful: https://dev.twitch.tv/docs/v5/guides/authentication/

If that doesn't help, you can look at my implementation of StreamKoala2 here: https://github.com/Skhmt/skhmt.github.io/tree/master/koala2

Let me know if this does or doesn't fix your issue. Leaving this open for now.

vagneralbino commented 7 years ago

I was using the wrong scope all along, and I even read the docs and comments. Silly me.

Either way, your Koala example really put things into perspective for me; thanks a lot for the help!