Hello everybody,
I’m currently developing a connector for opsdroid (an open-source python bot) and having some issues with webhooks. I’ve generated my OAuth as expected and I can query the API and also join the IRC servers with my tokens.
I’m currently trying to use webhooks to get other events that can’t get through the chat (like broadcaster went live).
We have the webserver running and the bot is exposed to the internet as well. We use aiohttp for the webserver and I’m trying to do the initial post to the endpoint like this:
followers_topic = f"https://api.twitch.tv/helix/users/follows?to_id={user_id}&first=1"
headers = {'Client-ID': self.client_id, 'Authorization': f"Bearer {self.token}"}
data = {
"hub.callback": 'https://REDACTED/connector/twitch/follows',
"hub.mode": 'subscribe',
"hub.topic": followers_topic,
"hub.lease_seconds": 60 * 60 * 4,
}
async with aiohttp.ClientSession() as session:
response = await session.post(TWITCH_API_ENDPOINT, headers=headers, data=data)
But every time I keep getting a status “400 - missing client secret” error. Nowhere In the documentation says we need to pass the client secret when attempting to subscribe to a webhook so I’m doing something wrong.
Any idea what that could be? I’ve seen the source code of a lot of libraries that use webhooks to connect to twitch and none use the client secret to subscribe to the webhook
Any help would be greatly appreciated.
Thank you so much!