May 18 2021 04:28 AM - edited May 18 2021 04:40 AM
Hi,
I've an Oauth App created in AAD thorough which i can access teams, channels and channels messages including attachments but not getting attachment content using the same token.
following as an example attachment url which i get from teams/{teamid}/channels/{channelid}/messages
but
when i try https://{mysubdomain}.sharepoint.com/sites/Public/Shared%20Documents/General/file.txt
it return 401 Unauthorized
following permissions are already given to the app.
Files.Read.All
Files.Read
ChannelMessage.Read.All
Please Guide on how to get the attachment using graph api.
May 19 2021 05:53 AM
@hidayat3676 _ You can send an attachment to teams, the file is saved in the share point, which you can view in the files folder of the team, You can get the file details and URL to the file in share-point using . But you cannot get the content of file using Graph API. Please check get filesfolder to get file
May 19 2021 11:04 PM
May 19 2021 11:55 PM
May 20 2021 01:34 AM
May 25 2021 10:59 PM
@hidayat3676 _ you will receive the file shared in the channel using Get files folder, which give the information about the file but it does not provide file content. If you want to get the file content you need to get the message when you shared the file in channel and usinng that message id get the file content using Get the raw contents of a file attachment on a message.