Spaces:
Runtime error
Runtime error
Greg Thompson
commited on
Commit
·
a901bc8
1
Parent(s):
642be75
Update to field for message API post request
Browse files
mathtext_fastapi/conversation_manager.py
CHANGED
|
@@ -41,8 +41,14 @@ def generate_message(data_json):
|
|
| 41 |
'Authorization': f"Bearer {os.environ.get('TURN_AUTHENTICATION_TOKEN')}",
|
| 42 |
'Content-Type': 'application/json'
|
| 43 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
data = {
|
| 45 |
-
"to":
|
| 46 |
# "to": "alan",
|
| 47 |
"type": "interactive",
|
| 48 |
"interactive": {
|
|
@@ -82,7 +88,7 @@ def generate_message(data_json):
|
|
| 82 |
print("Request Info")
|
| 83 |
print(r)
|
| 84 |
print("--")
|
| 85 |
-
print(r.body)
|
| 86 |
print("==================")
|
| 87 |
|
| 88 |
|
|
|
|
| 41 |
'Authorization': f"Bearer {os.environ.get('TURN_AUTHENTICATION_TOKEN')}",
|
| 42 |
'Content-Type': 'application/json'
|
| 43 |
}
|
| 44 |
+
|
| 45 |
+
whatsapp_id = data_json['message']['_vnd']['v1']['chat']['owner'].replace("+","")
|
| 46 |
+
|
| 47 |
+
print("DATA JSON")
|
| 48 |
+
print(data_json)
|
| 49 |
+
|
| 50 |
data = {
|
| 51 |
+
"to": whatsapp_id,
|
| 52 |
# "to": "alan",
|
| 53 |
"type": "interactive",
|
| 54 |
"interactive": {
|
|
|
|
| 88 |
print("Request Info")
|
| 89 |
print(r)
|
| 90 |
print("--")
|
| 91 |
+
# print(r.body)
|
| 92 |
print("==================")
|
| 93 |
|
| 94 |
|