Access files from shared onedrive folders
Hello,
When I use list_items it only lists the files under my root drive and not the files in shared folders, is there a way to access those?
Not entirely sure but most likely extra permissions required.
Thanks, I do have the permissions but It seems the path defaults to /drive/root and even using folder_path=different path it tries the url https://graph.microsoft.com/v1.0/me/drive/root:differentpath
Can you show your code?
hi, try this please:
from msdrive import OneDrive TOKEN_="EwBoBxxxLM" drive = OneDrive(TOKEN_) #items=drive.list_items(item_path="/Documents/")# Get root files
#here list your files from "YOUR_FOLDER" items=drive.list_items(folder_path="/YOUR_FOLDER/") # get files from your folder
for item in items["value"]: nombre = item["name"] tipo = "Carpeta" if "folder" in item else "Archivo" print(f"{nombre} - {tipo}")