# WebHook response from a "stream is offline" event

**URL:** <https://discuss.dev.twitch.com/t/webhook-response-from-a-stream-is-offline-event/18774>\
**Category:** API\
**Created:** [November 23, 2018, 6:01am UTC](https://discuss.dev.twitch.com/t/webhook-response-from-a-stream-is-offline-event/18774 "2018-11-23T06:01:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [November 23, 2018, 9:16am UTC](https://discuss.dev.twitch.com/t/webhook-response-from-a-stream-is-offline-event/18774/2 "2018-11-23T09:16:59Z")

</div>

The payload matches what the response is under helix API which is `data:[]` as per the webhooks specification.

But, there are a couple of options, you can parse one of the headers:

> [@Stream down \[WEBHOOK\]](https://discuss.dev.twitch.com/t/stream-down-webhook/15297/2):
>
> If you look in the headers of the request you can parse the “link” header: Something like (from my log) "link":"\<https://api.twitch.tv/helix/webhooks/hub\>; rel=\"hub\", \<https://api.twitch.tv/helix/users/follows?to\_id=TWITCHOD\>; rel=\"self\" So you can parse that out. Personally I’m using NodeJS and Express Param routing.

Or more usefully, is to setup, so that your callback URL is:

> [https://mydomain.com/twitchwebhooks/$webhooktype/$userid](https://mydomain.com/twitchwebhooks/$webhooktype/$userid)

For the hook

> [https://api.twitch.tv/helix/streams?user\_id=5678](https://api.twitch.tv/helix/streams?user_id=5678)

Which would result in you setting your Callback URL to

> [https://mydomain.com/twitchwebhooks/streams/5678](https://mydomain.com/twitchwebhooks/streams/5678)

Then just parse the URL for the parameters you need. Which is child’s play under nodeJS Express.

```auto
request.route('/twitchwebhooks/:hook/:id', function(req, resp) {
    switch (req.params.hook) {
        case 'streams':
            // snip

```

---

_[View the full topic](https://discuss.dev.twitch.com/t/webhook-response-from-a-stream-is-offline-event/18774)._
