I use axios to get the endpoint, my code is:
let access_token = ‘Bearer XXXXXXXXXX’
let client_id = 'khXXXXXXXXXXXXXXXXXXXXXXXXXXXX85'
const applications = axios.create({
baseURL: 'https://api.twitch.tv/helix/webhooks',
headers: {'Client_ID': client_id, 'Authorization': access_token, 'Content-Type': 'application/json'}
})
applications.post('/hub', {
"hub.callback": 'https://localhost',
"hub.mode": "subscribe",
"hub.topic": "https://api.twitch.tv/helix/streams?user_id=5XXXXXX6",
"hub.lease_seconds": 864000,
"hub.secret": "XXXXXXXXX!",
}).then(d => console.log(d)).catch(err => console.log(err))
I got the acces token a few minutes before, it’s working wth other requests (such as the channels endpoint) but not with this one, what am i doing wrong?
