# Webhooks subscribe accepted, but no received events

**URL:** <https://staging-discuss.dev.twitch.com/t/webhooks-subscribe-accepted-but-no-received-events/21776>\
**Category:** API\
**Created:** [July 11, 2019, 2:00am UTC](https://staging-discuss.dev.twitch.com/t/webhooks-subscribe-accepted-but-no-received-events/21776 "2019-07-11T02:00:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![twitch\_go](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/twitch_go/32/6664_2.png) [@twitch\_go](https://staging-discuss.dev.twitch.com/u/twitch_go)\
**Post date:** [July 11, 2019, 2:00am UTC](https://staging-discuss.dev.twitch.com/t/webhooks-subscribe-accepted-but-no-received-events/21776/1 "2019-07-11T02:00:06Z")

</div>

i tried webhooks subscribe ‘[https://api.twitch.tv/helix/subscriptions/events?broadcaster\_id=1234567890&first=1](https://api.twitch.tv/helix/subscriptions/events?broadcaster_id=1234567890&first=1)’

i can get accept message, but no received events.

my code is-\>

```
	var clientID = 'myID'
	var contentType = 'application/json'
	var postURI = 'https://api.twitch.tv/helix/webhooks/hub'
	var secret = 'secretvalue'
	var options =
		{
			headers: {
				'Client-ID': clientID,
				'Content-Type': contentType,
				'Authorization':'Bearer '+'myToken'
			},
			uri: postURI,
			method: 'POST',
			json: {
				"hub.mode":"subscribe",
				"hub.topic":"https://api.twitch.tv/helix/subscriptions/events?broadcaster_id=123456789&first=1",
				"hub.callback":"myCallback",
				"hub.lease_seconds":864000,
				"hub.secret":secret
			}
		}
	request(options,function(e,r,b) {
		console.log('Req status code : ' + r.statusCode);
		if(r.statusCode === 202) {
			console.log(r.statusMessage)
		} else {
			console.log;
		}
	});

route.post('/send',function (req,res) {
	console.log('post');
	req.on('data',function(chunk) {
		var data = '';
		data += chunk.toString();
		var rst = JSON.parse(data);
		console.log(rst);
	});
	res.status(200).send('done');
});

route.get('/send',function (req,res) {
	console.log('get');
	res.status(200).send(req.query['hub.challenge']);
});

```

thank you.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [July 11, 2019, 10:43am UTC](https://staging-discuss.dev.twitch.com/t/webhooks-subscribe-accepted-but-no-received-events/21776/2 "2019-07-11T10:43:14Z")

</div>

I don’t see anything _obviously_ wrong with your code.

I’m assuming you are actually setting this up for a “real” broadcaster\_id and thus with a “real” oAuth token.

The only other thing that is missing is the fact that an oAuth token is only valid for four hours so the lease time is overridden from 10 days, in your case, to four hours.

You can use the Webhook subscription status API to check for this and active webhooks

> **[Reference](https://dev.twitch.tv/docs/api/reference/#get-webhook-subscriptions)**
>
> Twitch Developer tools and services to integrate Twitch into your development or create interactive experience on twitch.tv.

---

<div class="post-metadata">

**Author:** ![twitch\_go](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/twitch_go/32/6664_2.png) [@twitch\_go](https://staging-discuss.dev.twitch.com/u/twitch_go)\
**Post date:** [July 11, 2019, 10:15pm UTC](https://staging-discuss.dev.twitch.com/t/webhooks-subscribe-accepted-but-no-received-events/21776/3 "2019-07-11T22:15:00Z")

</div>

thx for the reply.

I checked “hub.mode” and “hub.reason” is

“denied” and “unauthorized”.

I got Token from “OAuth Authorization Code Flow” and “OAuth Client Credentials Flow”.  
and I requested webhooks.  
but I received message 1) “Auth is required”. 2) Accepted, but hub.mode, hub.reason is “denied”, “unauthorized”

Which I get(use) Auth Token?

thx.

---

<div class="post-metadata">

**Author:** ![Dist](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://staging-discuss.dev.twitch.com/u/Dist)\
**Post date:** [July 12, 2019, 12:39am UTC](https://staging-discuss.dev.twitch.com/t/webhooks-subscribe-accepted-but-no-received-events/21776/4 "2019-07-12T00:39:47Z")

</div>

You need to use the Authorization Code Flow.

The Subscriptions Event topic requires the `channel:read:subscriptions` scope, so you need the streamer to go through your auth process to grant you the token to see their subscription events.

---

<div class="post-metadata">

**Author:** ![system](https://d2spem0quai2ol.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://staging-discuss.dev.twitch.com/u/system)\
**Post date:** [August 11, 2019, 12:39am UTC](https://staging-discuss.dev.twitch.com/t/webhooks-subscribe-accepted-but-no-received-events/21776/5 "2019-08-11T00:39:50Z")

</div>

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