Created
July 24, 2025 15:43
-
-
Save KyMidd/33998915666af6910b9690094aff5436 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_teams_conversation_history(user_graph_auth_token, event_body): | |
| #... | |
| if conversation_type == "channel": | |
| #... | |
| # Fetch all responses in the Post/thread | |
| url = f"https://graph.microsoft.com/v1.0/teams/{team_id}/channels/{channel_id}/messages/{parent_message_id}/replies" | |
| # Get previous messages | |
| response = requests.get(url, headers=headers) | |
| if response.status_code != 200: | |
| raise Exception(f"Graph API error {response.status_code}: {response.text}") | |
| data = response.json() | |
| messages = data.get("value", []) | |
| # Sort so we get the oldest first | |
| messages = list(reversed(messages)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment