A doubt about the parameters to put in the API

Hi, I’m using the official Twitch API (helix).

In particular I am using the request to obtain information “if the user is subscribed to a specific channel”.

https://api.twitch.tv/helix/subscriptions/user?broadcaster_id=[]&user_id=[]

There are two doubts

  1. Does the request return if the user is a subscriber (i.e. bought a subscription) to the token owner’s channel? Not the followers (who follow the channel), correct?

2)The second question is about the parameters to pass.
I had put as “broadcaster_id” the id of my channel and “user_id” the id of any user. But I get back an error saying that the token and the broadcaster_id must match. So I swapped the two parameters “broadcaster_id” and “user_id” and it returns me an answer (still to be tested if it is true). Shouldn’t the parameters be like the first time? I thought:
broadcaster_id = channel id (token owner)
user_id = id of a viewer anyone

Thanks

The Subscriptions API returns paid subscribers
The Follows API returns followers

This is a URL to the paid subscriptions API

You called the wrong API, you called “Check user Subscription” - Reference | Twitch Developers

When you should of called “Get Broadcaster Subscriptions” - Reference | Twitch Developers

Get Broadcaster Subscriptions uses a token with channel:read:subscriptions where the token user ID = the broadcaster_id
Check User Subscription users a token with user:read:subscriptions where the token user ID = the user_id

So you had the right params, you just called the wrong API.

So

https://api.twitch.tv/helix/subscriptions?broadcaster_id=123&user_id=321

Will look up if 321 is subbed to 123 when using 123s token

And

https://api.twitch.tv/helix/subscriptions/user?broadcaster_id=123&user_id=321

Will look up if 123 is subbed to 321 when using 321s token

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.