Omkar008 commited on
Commit
924753b
1 Parent(s): b11724a

Update test.py

Browse files
Files changed (1) hide show
  1. test.py +9 -0
test.py CHANGED
@@ -95,6 +95,15 @@ async def auth_google(request: Request):
95
  message_response = requests.get(message_url, headers={"Authorization": f"Bearer {access_token_new}"})
96
  message_data = message_response.json()
97
 
 
 
 
 
 
 
 
 
 
98
  # Check for parts in the message payload
99
  if "payload" in message_data and "parts" in message_data["payload"]:
100
  for part in message_data["payload"]["parts"]:
 
95
  message_response = requests.get(message_url, headers={"Authorization": f"Bearer {access_token_new}"})
96
  message_data = message_response.json()
97
 
98
+
99
+ if "payload" in message_data:
100
+ payload = message_data["payload"]
101
+ if "body" in payload and "data" in payload["body"]:
102
+ body_data = payload["body"]["data"]
103
+ body_content = base64.urlsafe_b64decode(body_data.encode("UTF-8")).decode("UTF-8")
104
+ print("Body Content:")
105
+ print(body_content)
106
+
107
  # Check for parts in the message payload
108
  if "payload" in message_data and "parts" in message_data["payload"]:
109
  for part in message_data["payload"]["parts"]: