Forum Discussion
How to Download Video Clip from Microsoft Teams Programmatically
I’m developing a bot app for Microsoft Teams, and part of its functionality involves handling videos recorded using the Teams widget(see screenshot attached).
I am receiving a video clip link in the bot app's backend message. Where is this video file uploaded and how can I download the video clip using that link?
I have attempted the SSO auth via Entra ID to fetch the auth token and attached it against the GET request to the video clip link as the bearer token. But still getting 401 errors?
Need help and guidance in this matter. Thanks.
6 Replies
- Sayali-MSFT
Microsoft
Hello AfrazKhan, If you want to download a video clip sent by a bot and do it programmatically, you should use below Graph API.
https://learn.microsoft.com/en-us/graph/api/chatmessage-get?view=graph-rest-1.0&tabs=http
- Prasad_Das-MSFT
Microsoft
Videos recorded using the Teams widget are typically stored in Microsoft Stream or OneDrive for Business, depending on your organization's settings. If you are getting a 401 error, it might be due to incorrect or insufficient permissions. Double-check the scopes and permissions granted to the token. You might need permissions like Files.Read.All or Sites.Read.All to access the video files.
- AfrazKhanCopper Contributor
Thanks for the help. I tried to attach the mentioned permissions with the token generated but still same issue.
I have done some furhture investigation, let me share that with you. Maybe you might help
Below is the format of the file link I receive in the bot app message.
https://as-api.asm.skype.com/v1/objects/0-at-g24-9238bn928bfnr47g3489hb72/views/video
Since I am able to download the file from the Teams client so I tried to investigate the HTTP GET request with Fiddler. I copied the token from the the request I saw in Fiddler and attempted to fetch the file from the code using that token for auth and file was downloaded successfully.
There is only one permission attached to that token ==> Teams.AccessAsUser.All
I tried to find this permission in the Entra ID app but couldn't find it.
Any idea about this?
- Prasad_Das-MSFT
Microsoft
We also checked and observed that, Teams.AccessAsUser.All permission is not available in Entra ID app.