Get the broadcaster_id and the user_id of any channel with the name

Get the broadcaster_id and the user_id of any channel with the name

You can user the “Get Users” endpoint to convert a name to an ID or vice versa.

A userID and a broadcasterID are the same thing, just different labels are used to describe data/parameters when working with relationships between entities

Not sure what you want from your vague title/post body. Since both are the same.

Uauuu thank you for answer quick.
Do if i want t know if a channel A is subscribed to channel B i take the names of the two channels i do a getusers of both, I take the ids and i call this endpoint with the two ids
https://api.twitch.tv/helix/subscriptions/user?broadcaster_id=${ id1 }&user_id=${id2 }`
And it will work ??

Correct

Get Users to convert the names to ID’s
Then use the ID"s on that subscribers endpoint

As long as the token you use has the right scopes attached.
For this endpoint you have shown you need a token for the user_id

what do you mean a token ?
I put the two ids and this is my error

  1. error: “Unauthorized”
  2. message: “Missing scope: user:read:subscriptions or user_subscriptions”
  3. status: 401

You need a token.

And that token will grant permission to perform this lookup in the API

But this token is the same token that i am using to do all the others endpoints in the headers or it’s another ???
because i do this in the other endpoints and it works
let headers = new HttpHeaders();
headers = headers.set(‘client-id’, this.apiKey);
headers = headers.set(‘Authorization’, “Bearer” + ’ '+ accesToken);

And I supose that i can do this endpoint for two random channels no and not mine?

Thank you for all

This token requires a user token with the scope user:read:subscriptions as the error reported. And that token ahs to belong toe user_id

You might have an App Access Token. Which is the wrong token type for this endpoint.

Different endpoints have different requirements for what the token allows.

okey i don’t know what i have to do but i need to know if I do this i will use this endpoint with all the broadcasters. I mean I can use this endpoint to know if Ibai is suscribed auronplay channels oe it’s only for my channel ?

For the Check User Subscriptions endpoint, you would need Ibai to go through your OAuth flow and grant you permission to view who they are subscribed to.

Alternatively there’s there Get Broadcast Subscriptions endpoint which would need the broadcaster to go through your OAuth flow, which in the case of your example would be auronplay.

You can’t check who a user is subscribed to, or who subscribes to a broadcaster, without the respective permission being granted from them.

What are you actaully trying to do?

Your broken english is not helping describe what you are trying to do

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