You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a bot that retrieves messages posted in Microsoft Teams. Using the Microsoft Graph API, I can successfully get the message details, including the attachments associated with a message. The relevant API call structure is:
When trying to download the attachment from the SharePoint URL, the file is not accessible due to SharePoint's permission requirements. It prompts for a Microsoft account login to access the file.
Is there a way to retrieve the file programmatically without requiring user authentication?
Any API recommendations or Graph permissions required to download the file directly?
@YavneshSM , Thanks for sharing the information.
The error message InvalidAuthenticationToken with the message Signing key is invalid indicates that there is an issue with the authentication token being used by your bot. This error is typically related to the token being expired, improperly signed, or otherwise invalid.
Please ensure that the token is issued for the correct resource and audience, specifically for the Microsoft Graph API with the necessary scopes required by your bot. Additionally, verify that the token is obtained using the correct client ID, client secret, and other credentials.
If you are using the On-Behalf-Of (OBO) flow, kindly confirm that the OBO token is being correctly obtained and utilized. Similarly, if you are using the client credentials flow, please ensure that the client ID, client secret, and tenant ID are correctly configured.
Type of issue
Other (describe below)
Feedback
I am working on a bot that retrieves messages posted in Microsoft Teams. Using the Microsoft Graph API, I can successfully get the message details, including the attachments associated with a message. The relevant API call structure is:
/users/{aad_user_id}/chats/{meeting_id}/messages/{message_id}
From the response, I can extract the attachment details such as:
Attachment ID
Attachment Name
Attachment Content URL (SharePoint URL)
Here is a sample content URL that I receive:
https://salientmind-my.sharepoint.com/personal/yavnesh_sharma_salientminds_com/Documents/Book1.xlsx
When trying to download the attachment from the SharePoint URL, the file is not accessible due to SharePoint's permission requirements. It prompts for a Microsoft account login to access the file.
Is there a way to retrieve the file programmatically without requiring user authentication?
Any API recommendations or Graph permissions required to download the file directly?
Page URL
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bots-filesv4
Content source URL
https://github.com/MicrosoftDocs/msteams-docs/blob/main/msteams-platform/bots/how-to/bots-filesv4.md
Author
@surbhigupta
Document Id
6bcc7af0-05b8-021d-0aad-8ac89e3d595c
The text was updated successfully, but these errors were encountered: