James_Un:
In python:
url = f"https://api.twitch.tv/helix/eventsub/subscriptions "
headers = {“Client-ID”: self.CLIENT_ID,
“Authorization”: “Bearer 2usysigpkwy25b427d8qz9h9vXXXXX”,
“Content-Type”: “application/json”}
post(url, headers=headers).json()
I don’t have a clue what’s going wrong
You seem to have not included a copy of your HTTP Post body for us to debug, so I’m guessing you didn’t send any at all. So that is likely your problem. You didn’t ask for a topic or specify a transport.
Here is a nodeJS example from my github
console.log(subscriptions_valid);
for (var topic in subscriptions_valid) {
if (!subscriptions_valid[topic]) {
console.log('Create', topic, subscriptions_to_make[topic]);
createSubscription(topic, subscriptions_to_make[topic]);
}
}
}
function createSubscription(type, thing) {
var condition = {};
condition[thing] = broadcaster_id;
var json = {
type,
version: "1",
condition,
transport: {
method: 'webhook',
callback: app_access_token.callback_url,
Relevant snippet
var json = {
type,
version: "1",
condition,
transport: {
method: 'webhook',
callback: 'some url',
secret: 'some jibberish'
}
};