Spaces:
Sleeping
Sleeping
from fastapi import FastAPI, Query, HTTPException | |
app = FastAPI() | |
VERIFY_TOKEN = "lintasmediadanawa" # Replace with your actual verify token | |
async def handle_webhook( | |
hub_mode: str = Query(..., alias="hub.mode"), | |
hub_challenge: int = Query(..., alias="hub.challenge"), | |
hub_verify_token: str = Query(..., alias="hub.verify_token") | |
): | |
if hub_mode == "subscribe" and hub_verify_token == VERIFY_TOKEN: | |
return int(hub_challenge) | |
else: | |
raise HTTPException(status_code=403, detail="Verification failed") |