Problem with my Twitch API

Hello,

Using your new Twitch api I came across a question which I am desperately trying to find the answer to.

I’m trying to display the moderators of my Twitch channel. I read on your Documentation that there are two mandatory parameters:

  • There must be the “moderation: read” Scope in my Token.
  • There must also be the ‘client_id’ corresponding the ‘boradcaster_id’

I have a question, espacially regarding that second part. How to add the ‘clien_id’ in the OAuth token? Because in the token recovery parameters you do not specify anything in relation to the ‘client_id’ parameter of the OAuth token. I’m confused, could I get help please?

Kamil Biczyk

broadcaster_id Provided broadcaster_id must match the user_id in the auth token.

It’s the Auth token that has to match the broadcaster. Meaning that you need the broadcaster (if this is for your own channel, this’ll be you) to go through the OAuth process for a User Access Token, that way the token will be for that channel.

Hello,

I wanted to thank you first.
Secondly everything that you told me I understood it well but despite that when I pass the cUrl request for moderation I have a message that I am not authorized in the Token.

But when I use a Twitch Token generator it works (https://twitchtokengenerator.com/).

By inspecting the two tokens the only difference is that the generator Token contains a “clien_id”. I don’t know how they put this clien_id in the Token. But I can’t do it.

Kamil Biczyk

It’s not advised to use this tool as you don’t have it’s client Secret.

So when you key dies you have to manually go get a new token from the website/tool and restart your scripts.

Both the ClientID and the Access Token are provided to the API with your call as headers. If you are using the token generator site, you’d need to use their ClientID

Hello,

I wanted to thank you first.

Infact, precisely the problem is that when I make the call to receive a twitch token, the token does not contain the client_id. So therein lies the problem. When I use the generator it puts the client_id which suits mine.

@BarryCarlyon?

The call you make has a client_id it is generated with a client_id

if you are using someone elses generator you’ll need to obtain their client id.

Which is why the advice is to not use those generator sites.

Not sure what you are actually asking in your last post.

The problem is that to get the moderators of my channel I must have the broadcaster_id which is equal to user_id in the token!

‘Provided broadcaster_id must match the user_id in the auth token.’

Except that when I generate my OAuth, it does not contain user_id!

How do I add the user_id to the token?

Use your token with the users API and don’t specify the ID or login optional query string paramaters

Ok, so how can I get moderators from my channel?

You call the users API to get the user ID

Then call the moderators API

A user_id is a broadcaster_id they are one and the same, just a different term is used in context to the endpoint

Could you come on my live?
I’m live and I’m showing you what’s wrong.

Can you come and post a message in the chat, i can explain you the problem…

No I don’t have the time to drop into a live stream.

I already answered how to get moderators, if you are having an error post the error and we can go from there

@BarryCarlyon might have your mail or discord to send you a video with the problem

A problem with code doesn’t require a video…

Whats the problem you are currently having? You getting a HTTP error code with a message? Or something not working right?

If your code is not working, you can post your code and explain the issue.

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