How can I check if a user is subscribed, without having to check among all subscribers, with the new api?
If there is a method with the new api, do you recommend using one of the v5?
How can I check if a user is subscribed, without having to check among all subscribers, with the new api?
If there is a method with the new api, do you recommend using one of the v5?
If you look at the docs for the Helix Get Broadcaster Subscriptions endpoint https://dev.twitch.tv/docs/api/reference#get-broadcaster-subscriptions you will see that there is an optional user_id
param, where you can specify up to 100 users at a time to see if they are subscribed to that broadcaster.
Thanks, I did not understand the parameter with the translator :sonrisa_sudor:
Hi i read from the docs
broadcaster_id -> User ID of the broadcaster. Must match the User ID in the Bearer token.
but in order to obtain the User OAuth Token, we usually must create a link to https://id.twitch.tv/oauth2/authorize with parameters client_id, redirect_uri, response_type, state.
After authorize it, we receive a json with access_token (that we use as Bearer token).
So, please me more regarding this broadcaster_id to insert into Bearer Token.
Thank you in advance
The step by step instructions on getting OAuth tokens are here: https://dev.twitch.tv/docs/authentication/getting-tokens-oauth
You need to use either the Implicit flow, or the Auth Code flow, as that requires you to send the broadcaster to the Twitch page to choose if they wish to grant your app permission to viewer their list of subscribers.
Mmm, so i suppose i can’t use it to check if a certain user_id has an active subscription on a certain channel, right?
You can if the channel has granted your app permission to access their subscribers list.
My app should be used by users: after the login, i would to check if the user is subscribed to a specific channel id, isn’t possible?
That’s only possible using the deprecated Get User Subscriptions endpoint https://dev.twitch.tv/docs/v5/reference/users#check-user-subscription-by-channel but being deprecated it’s not something that should be relied on as it will be removed in the future.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.