Few questions about web hooks and user Ids

I am working on a discord bot and want to have it to notify a certain channel when my friend goes live. I have the discord part down fine but am struggling with Twitch and the web hooks.

Lets just get this out of the way now… heres the code

My questions are as followed, first how do I get the user_id? I was hoping I could use the user_login from the old v5 api but it doesn’t seem to work for this. I am also unsure about the hub.secret. Should that be the secret api key twitch gives us when creating the bot? I know I need to add the callback but for now I am just trying to get the subscription verify response.

The webhook for streams only accepts user_id as documented

yeah I know. I was trying to do it the user_id way but didn’t know how to find my id so I tried this way. My first question was how do I get the user_id cause I realized that it wouldn’t work the way I tried.

Use helix/users to look up the user ID.

Ex: https://api.twitch.tv/helix/users?login=george

"data": [
"id": "13074",
"login": "george",
"display_name": "George",
"type": "admin",
"broadcaster_type": "",
"description": "Kappa Kappa Kappa Kappa Kappa",
"profile_image_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/george-profile_image-12ffa345210ef26e-300x300.png",
"offline_image_url": "",
"view_count": 14843

My user_id would be “13074”.

1 Like

thanks. I don’t know what I was thinking.

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