from fastapi import FastAPI, Request from fastapi.responses import JSONResponse app = FastAPI() @app.post("/webhook") async def webhook(request: Request): data = await request.json() # Process the incoming data print(f"Received data: {data}") # Prepare a response response_data = { "message": "Hello! This is an automatic reply.", "received": data } return JSONResponse(content=response_data)