Add Teams message history API#491
Draft
heyitsaamir wants to merge 11 commits into
Draft
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Microsoft Graph-backed Teams message history API for app-level and context-level callers, plus a focused example app for manual testing.
API
Reactive context API
ctx.get_history(n)infers the current scope from the inbound activity:GET /chats/{chat-id}/messagesGET /teams/{team-aad-group-id}/channels/{channel-id}/messagesreply_to_idor;messageid=<root>and calls.../messages/{root-message-id}/repliesFor channel history, the SDK requires the Teams activity to include
team.aad_group_id; this is the Graph team resource ID used by RSC.App-level API
Invalid target combinations raise
ValueError; Graph errors propagate unchanged. The helper requests up to Graph's 50-message page limit per call and follows@odata.nextLinkuntil it returnsnmessages or Graph runs out of pages.Caveats
Example
Adds
examples/historywith commands to test:history/history ctx <n>history chat <chat-id> [n]history channel <team-aad-group-id> <channel-id> [n]history thread <team-aad-group-id> <channel-id> <thread-id> [n]