Spaces:
Runtime error
Runtime error
Commit ·
067f6ee
1
Parent(s): 3247d29
update wati issue
Browse files
app.py
CHANGED
|
@@ -266,7 +266,7 @@ def capture_lead(user: lead_client.User):
|
|
| 266 |
|
| 267 |
# Credentials from your Wati API Docs page
|
| 268 |
WATI_API_ENDPOINT = "https://live-mt-server.wati.io/10131646"
|
| 269 |
-
WATI_BEARER_TOKEN = "
|
| 270 |
|
| 271 |
@app.post("/webhook")
|
| 272 |
async def handle_wati_webhook(request: Request):
|
|
@@ -319,7 +319,8 @@ async def send_wati_session_message(to_number: str, text: str):
|
|
| 319 |
}
|
| 320 |
|
| 321 |
async with httpx.AsyncClient() as client:
|
| 322 |
-
response = await client.post(url,
|
|
|
|
| 323 |
return response.json()
|
| 324 |
|
| 325 |
if __name__ == "__main__":
|
|
|
|
| 266 |
|
| 267 |
# Credentials from your Wati API Docs page
|
| 268 |
WATI_API_ENDPOINT = "https://live-mt-server.wati.io/10131646"
|
| 269 |
+
WATI_BEARER_TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6InRoZW9waW5pb25iZW5jaEBnbWFpbC5jb20iLCJuYW1laWQiOiJ0aGVvcGluaW9uYmVuY2hAZ21haWwuY29tIiwiZW1haWwiOiJ0aGVvcGluaW9uYmVuY2hAZ21haWwuY29tIiwiYXV0aF90aW1lIjoiMDQvMTAvMjAyNiAxMzozMDo1MiIsInRlbmFudF9pZCI6IjEwMTMxNjQ2IiwiZGJfbmFtZSI6Im10LXByb2QtVGVuYW50cyIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6IkFETUlOSVNUUkFUT1IiLCJleHAiOjI1MzQwMjMwMDgwMCwiaXNzIjoiQ2xhcmVfQUkiLCJhdWQiOiJDbGFyZV9BSSJ9._xKqCk8XJlFuCbPg9Jx1tOfNDpIefxYFF6wvQ6owt2k" # Copy full token from your screen
|
| 270 |
|
| 271 |
@app.post("/webhook")
|
| 272 |
async def handle_wati_webhook(request: Request):
|
|
|
|
| 319 |
}
|
| 320 |
|
| 321 |
async with httpx.AsyncClient() as client:
|
| 322 |
+
response = await client.post(url, params=payload, headers=headers)
|
| 323 |
+
logger.info(f"Wati Response: {response.status_code} - {response.text}")
|
| 324 |
return response.json()
|
| 325 |
|
| 326 |
if __name__ == "__main__":
|