Omkar008 commited on
Commit
bd14002
1 Parent(s): d8d644b

Update test.py

Browse files
Files changed (1) hide show
  1. test.py +4 -0
test.py CHANGED
@@ -117,7 +117,10 @@ async def test_google(code:str):
117
  message_url = f"https://www.googleapis.com/gmail/v1/users/me/messages/{message_id}"
118
  message_response = requests.get(message_url, headers={"Authorization": f"Bearer {access_token}"})
119
  message_data = message_response.json()
 
120
  print(message_data)
 
 
121
  subject = ''
122
  body = ''
123
  if 'payload' in message_data and 'headers' in message_data['payload']:
@@ -133,6 +136,7 @@ async def test_google(code:str):
133
  body_data = part['body']['data']
134
  body = base64.urlsafe_b64decode(body_data)
135
  print("Subject:", subject)
 
136
  print("Body:", body)
137
 
138
  # Check for parts in the message payload
 
117
  message_url = f"https://www.googleapis.com/gmail/v1/users/me/messages/{message_id}"
118
  message_response = requests.get(message_url, headers={"Authorization": f"Bearer {access_token}"})
119
  message_data = message_response.json()
120
+ print("printing message_data response json")
121
  print(message_data)
122
+ print("Finished printing message_data response json")
123
+
124
  subject = ''
125
  body = ''
126
  if 'payload' in message_data and 'headers' in message_data['payload']:
 
136
  body_data = part['body']['data']
137
  body = base64.urlsafe_b64decode(body_data)
138
  print("Subject:", subject)
139
+
140
  print("Body:", body)
141
 
142
  # Check for parts in the message payload