Need help about twitch.tv application

Hello to everybody,
I am new to twitch.tv, and my goal is to write a Telegram bot who check if a user is a subscriber of a particular twitch channel… I just registered a twitch app but I don’t know which OAuth redirect URL I have to specify.
Could someone tell me its meaning ?
Another question is related to the code… how to write the code which check if a user is registered to this channel ?
Advanced thanks to everybody will help me.

That would be the URL/website you redirect the user to, to complete step 3 of regular user oAuth

Exchanging a code for an access (and refresh) tokens.

And thus the website that will talk to your key storage to store the keys for your bot to use.

This API references how to use the subscribers endpoint

Hello Barry,
Thanks for reply me…
Do you mean is the website where I want to redirect the response ?
For example, if I want that the response will be redirected to www.mywebsite.com; I have to write this URL ?
Another question is related to tokens… I have not understood its meaning and, how to use it.
Do you mean that, for my purpose, just enough an empty twitch app ?

oAuth in a nutshell

  • Someone comes to your website, in order to grant access to your application to your Twitch account
  • They click a link that takes them to twitch
  • They accept (or deny) the application link (and any additional permissions or scopes)
  • If they accept they come back to your website with a ?code
  • You exchange the ?code for an access token/refresh token key pair
  • You store (and use the keys)

It’ll be the URL to the page/script that handles the final oAuth steps

An access token is “like a password” that you provide to the Twitch API that will confirm if you have the rights to read someones subscribers.

You provide the token as a header when making calls to the API

So to call the subscribers endpoint, you do as follows

curl -X GET 'https://api.twitch.tv/helix/subscriptions?broadcaster_id=123' \
-H 'Authorization: Bearer cfabdegwdoklmawdzdo98xt2fo512y' \
-H 'Client-Id: uo6dggojyb8d6soh92zknwmi5ej1q2'

From the docs, you send the Authorization token for the broadcaster 123 which’ll let you read the subscribers

Hello again…
In your last reply
‘Authorization: Bearer cfabdegwdoklmawdzdo98xt2fo512y’ and ‘Client-Id: uo6dggojyb8d6soh92zknwmi5ej1q2’ is the token I have to send in addressing my App ?
How generate it ?
Thanks again for you reply !!!

Authentication is covered here.

The Client-ID is the clientID of your application you made on the dev console.

I already covered the “main steps”

Sorry, but I don’t understand a lot…
My telegram bot send a request to my twich App, my App should check if the user is registered to a particular twich channel.
So I am asking, how to write code ?
I don’t have seen any editor for doing it.
How exactly my twicht App should react ?
Should my twitch App generate the tokens or, something else ?

I’ve linked you the documentation.

I can provide fixes to code, but I’m not gonna write the code for you.

The next step is to pick a language and start programming.

There are some authentication examples on my github that might help you, but there are no practical examples you can jsut copy and paste

Ok, thanks againg… I’ll give a look
But, how to edit the code ? I really have any idea.

I do not understand your question

Once created my twich App, then I have to code it… so I want know how to open editor and code it.
From your github, it seems me I should use PHP language, right ?

You can use whatever programming language you want, my github has nodejs, php and pythong examples.

As long as the langauge can make cURL requests and serve webpages then you can built an app to authenticate users and make the relevant calls.

Sorry, but I don’t really understand about anything…
You are very polite, and it’s all my guilt; so I am asking if there is some tutorial to create a OAuth Twitch App from scratch… thanks again.

If you don’t understand anything then first you need to learn the basics of a programming language

You need to learn to walk before you can run.

I teach computer science in a high school, here in Italy; I wrote many applications in C#, C++, Java and PHP language… but Twich is absolutely new for me.
For example, how to get tokens ?

For a user access token which is what you would need to read subscribers

What’s ‘?code’ ? I really don’t understand.
Anyway is my twitch App should check if user is registered to a specified channel, not my website, which is external to twitch…

?code is returned as the query string parameter when the user comes back to your website after accepting the application link

See step 2

Let me check if I have understood…
Once user is succesfully autheticated in Twich, it returns to my website; but how could check if he/she is registered to a specified twich channel from here ?
Only twich server should check it…

Assuming by registered your mean “subscribed” as per your OP

you will need an authentication token from the broadcaster that allows you to read their subscribers as documented