Hey, I’m currently working on a service to forward Twitch webhooks to discord. I am encountering several issues though.
The main issue is with webhook creation. The documentation page is not entirely clear on how to setup the callback url, so I’ll explain what I have tried. I have sent the request to twitch’s servers with the correct topic, mode, and callback. On the callback server I have it setup where if it recieves a GET request from twitch, it will respond with the hub.challenge sent in the url query string along with a 202 accepted status code. Here is the core code I’m using for that. Language is Node.js using Express.
From there I get nothing else from Twitch, not sure if I am supposed to. I then test the event which triggers the webhook, gaining a follower in this case. I gain a follower and nothing is sent to the callback server. No post request, nothing. Have I done something wrong?
You don’t send a 202 you send a 200, with the bodt as the hub_challenge GET argument (which I’ve been receiving as hub_challenge rather than hub.challenge. So cross check what you are receiving
The response to the (cURL) subscribe request is a 202 Created.
Even with the 200 request the webhook isn’t functioning. Does twitch send a confirmation showing that the webhook was created? If so where does this get sent.
If you replied with the challenge correctly. Then all should be good
Looks like you are using node. So make sure you bound a POST route on express of that is what you are using. I can post my sample code when I’m back at a pc.