jonathanjordan21 commited on
Commit
1abb68b
·
verified ·
1 Parent(s): d15daf6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -0
app.py CHANGED
@@ -61,3 +61,31 @@ async def handle_event_notifications(
61
 
62
  # Return a 200 OK response to acknowledge receipt
63
  return {"status": "ok"}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  # Return a 200 OK response to acknowledge receipt
63
  return {"status": "ok"}
64
+
65
+
66
+
67
+ @app.post("/webhooks")
68
+ async def get_all_params(request: Request):
69
+ # Get headers
70
+ headers = dict(request.headers)
71
+
72
+ # Get query parameters
73
+ query_params = dict(request.query_params)
74
+
75
+ # Get the body (as JSON or raw data)
76
+ try:
77
+ body = await request.json() # Parse JSON if possible
78
+ except Exception:
79
+ body = await request.body() # Fall back to raw body if not JSON
80
+
81
+ # Combine all details
82
+ all_params = {
83
+ "headers": headers,
84
+ "query_params": query_params,
85
+ "body": body,
86
+ }
87
+
88
+ # Log the params (optional)
89
+ print(all_params)
90
+
91
+ return all_params