Spaces:
Running
Running
Update test.py
Browse files
test.py
CHANGED
@@ -62,7 +62,7 @@ async def auth_google(request: Request):
|
|
62 |
# print(access_token_new)
|
63 |
user_info = requests.get("https://www.googleapis.com/oauth2/v1/userinfo", headers={"Authorization": f"Bearer {access_token_new}"})
|
64 |
# user_query = data.get("user_query")
|
65 |
-
query = "has:
|
66 |
gmail_url = f"https://www.googleapis.com/gmail/v1/users/me/messages?q={query}&maxResults=10"
|
67 |
gmail_response = requests.get(gmail_url, headers={"Authorization": f"Bearer {access_token_new}"})
|
68 |
messages = gmail_response.json().get("messages", [])
|
|
|
62 |
# print(access_token_new)
|
63 |
user_info = requests.get("https://www.googleapis.com/oauth2/v1/userinfo", headers={"Authorization": f"Bearer {access_token_new}"})
|
64 |
# user_query = data.get("user_query")
|
65 |
+
query = "subject:receipts has:attachment"
|
66 |
gmail_url = f"https://www.googleapis.com/gmail/v1/users/me/messages?q={query}&maxResults=10"
|
67 |
gmail_response = requests.get(gmail_url, headers={"Authorization": f"Bearer {access_token_new}"})
|
68 |
messages = gmail_response.json().get("messages", [])
|