My subscription does indeed have the status “webhook_callback_verification_failed” after the initial launch thank you already!
I do respond to the callback verification with the challenge successfully on my side though, but I reckon this is where the SSL problem you mentioned comes into play right?
I’ll leave my eventsub handler here if that helps
@app.post("/webhook")
async def handle_eventsub(request: Request):
secret = "<~>"
if not await verify_signature(request, secret):
return JSONResponse(status_code=401, content={"status": "invalid signature"})
headers = request.headers
body = await request.json()
print("Received request:", headers, body)
if "Twitch-Eventsub-Message-Type" in headers:
message_type = headers["Twitch-Eventsub-Message-Type"]
print("Message type:", message_type)
if message_type == "webhook_callback_verification":
challenge = body["challenge"]
print("Received webhook_callback_verification, responding with challenge:", challenge)
return JSONResponse(content={"challenge": challenge})
elif message_type == "notification":
event = body["event"]
print("Received notification event:", event)
reward_title = event["reward"]["title"]
user = event["user_name"]
custom_input = event["user_input"]
if reward_title == reward_name:
print(f"User {user} redeemed the reward '{reward_title}' with input: {custom_input}")
handle_reward(custom_input)
print(custom_input)
return JSONResponse(content={"status": "ok"})