Programatically accessing files shared in teams

%3CLINGO-SUB%20id%3D%22lingo-sub-763916%22%20slang%3D%22en-US%22%3EProgramatically%20accessing%20files%20shared%20in%20teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-763916%22%20slang%3D%22en-US%22%3E%3CP%3EMy%20group%20has%20filed%20stored%20in%20teams%20channels.%20They're%20basically%20using%20excel%20files%20for%20data%20entry.%20I'd%20like%20to%20access%20them%20automatically%2Fprogramatically%20for%20data%20analysis.%3C%2FP%3E%3CP%3EIdeally%20in%20Python%2C%20but%20I'm%20open%20to%20any%20language.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EANY%20solution%20that%20automatically%20mirrors%20a%20Teams%20file%20to%20a%20hard%20drive%20would%20be%20wonderful%20as%20an%20alternative.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20is%20a%20REST%20API%20for%20365%20but%20it%20doesn't%20seem%20to%20provide%20the%20functionality%20I%20need%20based%20on%20the%20Microsoft.com%20docs%2C%20it's%20only%20for%20accessing%20files%20in%20public%20chat%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESee%20my%20stack%20overflow%20post%20here%20if%20you%20want%20to%20dive%20into%20some%20code%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F57103597%2Fgrabbing-files-from-microsoft-teams-using-python%3Fnoredirect%3D1%23comment100729051_57103597%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F57103597%2Fgrabbing-files-from-microsoft-teams-using-python%3Fnoredirect%3D1%23comment100729051_57103597%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-763916%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFiles%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-766335%22%20slang%3D%22en-US%22%3ERe%3A%20Programatically%20accessing%20files%20shared%20in%20teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-766335%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F378700%22%20target%3D%22_blank%22%3E%40cklapperichmn%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20I%20get%20your%20needs%20right.%20From%20my%20point%20of%20view%2C%20you%20just%20need%20to%20build%20a%20flow%20that%20copies%20the%20files%20from%20the%20SharePoint%20Online%20folder%20to%20another%20place%20where%20you%20can%20grab%20them%3F%20Maybe%20you%20should%20have%20a%20look%20at%20this%20option...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESven%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-768234%22%20slang%3D%22en-US%22%3ERe%3A%20Programatically%20accessing%20files%20shared%20in%20teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-768234%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F252930%22%20target%3D%22_blank%22%3E%40svenseidenberg%3C%2FA%3EThanks%20so%20much.%20You%20have%20a%20good%20grasp%20of%20my%20problem%2Fneeds%2C%20yp!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20manged%20to%20set%20up%20a%20%22folder%20sync%22%20that%20moves%20them%20to%20a%20local%20place%20on%20my%20C%3A%5C%20drive%20but%20a%20network%20drive%20would%20be%20cooler.%20Now%20people%20edit%20documents%20in%20teams%20and%20it%20shows%20up%20on%20my%20hard%20drive!%20I%20can't%20figure%20out%20how%20to%20change%20the%20sync%20to%20another%20folder.%20is%20there%20a%20way%20to%20do%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOr%2C%20any%20good%20tutorials%20for%20setting%20up%20a%20flow%20to%20move%20from%20Sharepoint%20to%20a%20network%20dir%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1386586%22%20slang%3D%22en-US%22%3ERe%3A%20Programatically%20accessing%20files%20shared%20in%20teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1386586%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F252930%22%20target%3D%22_blank%22%3E%40svenseidenberg%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20not%20able%20see%20the%20option%20which%20you%20mentioned.%20My%20requirement%20is%20also%20similar.%20I%20have%20to%20access%20all%20the%20files%20present%20in%20a%20folder%20(in%20MS%20Teams)%20and%20get%20those%20into%20PowerBI%20and%20later%20use%20them%20for%20file%20manipulation.%3C%2FP%3E%3CP%3EDiagram%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMS%20TEAMS%20(folder%2C%20containing%20files)----------------accessed%20by----------------------%26gt%3B%20PowerBI%20(containing%20python%20script).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20access%20all%20these%20files%20using%20python%2C%20and%20the%20python%20script%20is%20in%20powerBI%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20and%20regards.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1386672%22%20slang%3D%22en-US%22%3ERe%3A%20Programatically%20accessing%20files%20shared%20in%20teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1386672%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F666406%22%20target%3D%22_blank%22%3E%40hanumntha03%3C%2FA%3EI%20got%20this%20working.%20I%20used%20the%20%22open%20in%20sharepoint%22%20option%20in%20teams%2C%20then%20used%20the%20%22sync%22%20option%20to%20sync%20the%20folder%20to%20a%20local%20folder%20on%20the%20hard%20drive.%20Then%20python%20could%20read%20from%20the%20local%20folder%20and%20the%20data%20stayed%20up%20to%20date.%20Worked%20well.%20Must%20have%20the%20one-drive%20app%20running%20on%20your%20PC.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1386687%22%20slang%3D%22en-US%22%3ERe%3A%20Programatically%20accessing%20files%20shared%20in%20teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1386687%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F666450%22%20target%3D%22_blank%22%3E%40christopherklapperich%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eso%20can't%20we%20directly%20access%20files%20without%20%22using%20them%20in%20sharepoint%22.%20I%20have%20seen%20that%20there%20is%20an%20option%20given%20for%20a%20folder%20where%20we%20can%20use%20the%20%22copy%20link%22%20option%20can%20we%20use%20this%20to%20get%20all%20files%20in%20the%20folder%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

My group has filed stored in teams channels. They're basically using excel files for data entry. I'd like to access them automatically/programatically for data analysis.

Ideally in Python, but I'm open to any language.

 

ANY solution that automatically mirrors a Teams file to a hard drive would be wonderful as an alternative. 

 

There is a REST API for 365 but it doesn't seem to provide the functionality I need based on the Microsoft.com docs, it's only for accessing files in public chat?

 

See my stack overflow post here if you want to dive into some code: https://stackoverflow.com/questions/57103597/grabbing-files-from-microsoft-teams-using-python?noredi...

5 Replies

Hi @cklapperichmn,

 

I hope I get your needs right. From my point of view, you just need to build a flow that copies the files from the SharePoint Online folder to another place where you can grab them? Maybe you should have a look at this option...

 

Sven

Highlighted

@svenseidenbergThanks so much. You have a good grasp of my problem/needs, yp!

 

I manged to set up a "folder sync" that moves them to a local place on my C:\ drive but a network drive would be cooler. Now people edit documents in teams and it shows up on my hard drive! I can't figure out how to change the sync to another folder. is there a way to do this?

 

Or, any good tutorials for setting up a flow to move from Sharepoint to a network dir?

 

Thanks.

Highlighted

@svenseidenberg 

 

I am not able see the option which you mentioned. My requirement is also similar. I have to access all the files present in a folder (in MS Teams) and get those into PowerBI and later use them for file manipulation.

Diagram:

 

MS TEAMS (folder, containing files)----------------accessed by----------------------> PowerBI (containing python script).

 

I need to access all these files using python, and the python script is in powerBI

 

Thanks and regards.

Highlighted

@hanumntha03I got this working. I used the "open in sharepoint" option in teams, then used the "sync" option to sync the folder to a local folder on the hard drive. Then python could read from the local folder and the data stayed up to date. Worked well. Must have the one-drive app running on your PC.

Highlighted

@christopherklapperich 

 

so can't we directly access files without "using them in sharepoint". I have seen that there is an option given for a folder where we can use the "copy link" option can we use this to get all files in the folder?