Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -475,8 +475,15 @@ def handle_product_integration(access_token, product):
|
|
| 475 |
else:
|
| 476 |
st.write(f"No integration implemented for {product}.")
|
| 477 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 478 |
# ๐จ Function to get Outlook messages
|
| 479 |
-
def
|
| 480 |
headers = {'Authorization': 'Bearer ' + access_token}
|
| 481 |
response = requests.get('https://graph.microsoft.com/v1.0/me/messages?$top=5', headers=headers)
|
| 482 |
if response.status_code == 200:
|
|
@@ -523,8 +530,15 @@ def get_user_teams(access_token):
|
|
| 523 |
st.write(response.text)
|
| 524 |
return []
|
| 525 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 526 |
# ๐
Function to get upcoming events
|
| 527 |
-
def
|
| 528 |
headers = {'Authorization': 'Bearer ' + access_token}
|
| 529 |
response = requests.get('https://graph.microsoft.com/v1.0/me/events?$orderby=start/dateTime&$top=10', headers=headers)
|
| 530 |
if response.status_code == 200:
|
|
|
|
| 475 |
else:
|
| 476 |
st.write(f"No integration implemented for {product}.")
|
| 477 |
|
| 478 |
+
def get_outlook_messages():
|
| 479 |
+
messages = make_api_call('me/messages?$top=5')
|
| 480 |
+
if messages:
|
| 481 |
+
return messages.get('value', [])
|
| 482 |
+
return []
|
| 483 |
+
|
| 484 |
+
|
| 485 |
# ๐จ Function to get Outlook messages
|
| 486 |
+
def get_outlook_messages2(access_token):
|
| 487 |
headers = {'Authorization': 'Bearer ' + access_token}
|
| 488 |
response = requests.get('https://graph.microsoft.com/v1.0/me/messages?$top=5', headers=headers)
|
| 489 |
if response.status_code == 200:
|
|
|
|
| 530 |
st.write(response.text)
|
| 531 |
return []
|
| 532 |
|
| 533 |
+
def get_upcoming_events():
|
| 534 |
+
events = make_api_call('me/events?$orderby=start/dateTime&$top=10')
|
| 535 |
+
if events:
|
| 536 |
+
return events.get('value', [])
|
| 537 |
+
return []
|
| 538 |
+
|
| 539 |
+
|
| 540 |
# ๐
Function to get upcoming events
|
| 541 |
+
def get_upcoming_events2(access_token):
|
| 542 |
headers = {'Authorization': 'Bearer ' + access_token}
|
| 543 |
response = requests.get('https://graph.microsoft.com/v1.0/me/events?$orderby=start/dateTime&$top=10', headers=headers)
|
| 544 |
if response.status_code == 200:
|