Hello there, dear community and fellow developers,
I’m implementing Web Hooks to get notifications when streamers go online/offline.
So far I’ve managed to send subscription request, get 202, and get confirmation GET request to callback handler with correct params:
(no quotes or whitespace before or after), HTTP status 200
I believed that would get me subscribed.
Was I wrong, apparently, as when I put stream online/offline (using OBS streaming software), I receive no more requests to callback handler.
I use php and the code like below to see what’s up:
When you test, are you staying online for some time, or just going online then immediately offline? Webhooks have several minutes delay to give time for all the API servers time to update so that any webhook notification will be consistent with the API. This also means that a stream going online then offline shortly after, or a stream that is already online having a brief outage, wont send notifications.
Without seeing your code, another point that sometimes causes people trouble is not realising the notification is a POST request, so make sure your handler is capable of dealing with that type of request rather than just a GET.
I just edited my question to include the code I use to see what’s up (on the handler).
As for the stream, I tried streaming for about 5-10 minutes to no avail.
Just now started again, will let it run for 30-60 minutes to allow all updates… I’ll post if it helps in 30-60 minutes :).
I’m not a PHP guy so can’t really offer much help with your code. You’re at least getting the challenge verification so you know your GET handler is working, have you tried POST’ing to your own callback URL yourself just so you can check that it is getting the POST requests correctly?