Not receiving webhook events

I am trying to receive webhook data, but no matter what I do I am not getting anything.

I receive <MultiDictProxy('hub.challenge': '22v9NqX2HsQHuh5MVGPhtJUtCKcyQzewRTBKlGOW', 'hub.lease_seconds': '864000', 'hub.mode': 'subscribe', 'hub.topic': 'https://api.twitch.tv/helix/streams?user_id=127347964')>

And I am echoing back the challenge, in text/plain. But I am not getting stream events.

Have you tried the Check Webhook Subscriptions endpoint to ensure that the subscription has been created? Also, have you tested your POST handler to make sure it is accessible and working?

Using that endpoint gives me an Unauthorised 401.

My POST request receives and 202 Accepted.
My callback handler is working perfectly and is receiving and echoing back the challenge.

http://125.168.57.102:8080/0bb19c3bceaf46e2b08dc0db283e1e4d?hub.mode='subscribe'&hub.challenge=67389nu40n6u873b464nbu38-0

If you want to see the response

The check subscriptions endpoint requires using an App access token, so if you’re getting a 401 then it’s likely you’re just using a Client ID rather than an App token.

Checking your GET request and comparing it to mine, only main differences I see is the content type, as mine responds with ‘application/json’, although I’m not sure if that will be an issue, check the check subscriptions endpoint with an app token first as if that’s showing a subscription then your GET is fine.

Also, you don’t need to respond with your client-id in the header. It’s not a security issue as it’s just a client id, but something to keep in mind if you switch to subscribing to webhooks with an App token instead and start exposing that then it’ll be a big issue.

I can confirm 3 active subscriptions

So everything seems fine, minus the fact nothing happens lol

Off the top of my head, the only thing I can think of is are you using any sort of proxy, such as NGINX, or firewall that may be blocking the incoming POST traffic?

And just to check are you also sure you’re doing something to trigger notifications to be sent in the first place? For example turning the stream off and on again wont do anything if you do it too quickly as there is a delay of several minutes before notifications are sent and if it’s just a small outage then it may not trigger any notification to be sent. Changing game or title should work to but again will be delayed by several minutes.

I have turned stream on an waited 20 minutes still nothing. I have also tested on bigger streams that have now gone offline. I’m not using a proxy, so that shouldn’t be an issue. And I’m not using any firewalls. And it wouldn’t make sense anyway since I receive the challenge. I could try changing ports to see what that does.

That doesn’t seem to have done anything either. All ports are open as well and others have been able to send me requests externally. So I’m stumped

I’m on Ubuntu if that has any significance. Other than that I don’t know what to say.

Fixed. It seems I was shadowing a function from the web server. God knows why it didn’t error.

Sorry for wasting your time, I appreciate the help.

No problem, I’m glad you managed to find and fix the cause of the issue :slight_smile:

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