I am using python with the sharepy module to make requests to sharepoint. I would really like to know to get get all of the folders, subfolders, and files of a sharepoint site via a http request. I can list folders and files like so:
r = s.get(spo_site + """_api/web/GetFolderByServerRelativeUrl('""" + root_folder + """')/Folders""")
But it need it to go deep into the folder structure to get the relative urls and names of the files and folders. I would think this would be possible considering most sites have an export to excel button. The reason I want to do this with code because I need to go through a bunch of sites. Please Help.
Mike Smith response answered my question. My code is like this:
r = s.get(spo_site + """_api/web/lists/getbytitle('Documents')/items?$select=FileLeafRef,FileRef&$top=5000)
This works great but the limit is 5000 items. I am going to need much more than this. Is there a solution for this?