I am trying to use a Python script to upload a CSV file to a SharePoint personal directory, with a URL like: https://{tenant}-my.sharepoint.com/personal/{user}_{tenant}_com/Documents/{path} I have configured SharePoint API access with a client_id and client_secret in the main tenant domain (using _layouts/15/appregnew.aspx and _layouts/15/appinv.aspx, and granted these permissions as admin. I am unclear whether I can use these to upload a file to a personal directory like above. from office365.runtime.auth.client_credential import ClientCredential from office365.sharepoint.client_context import ClientContext import os site_url = "" # IS THIS THE TENANT-MY.SHAREPOINT.COM URL LIKE ABOVE? client_id = "" client_secret = "" file_path = "path/to/your/local/file.csv" folder_url = "Shared Documents" # IS THIS THE TENANT-MY.SHAREPOINT.COM PATH LIKE ABOVE? try: credentials = ClientCredential(client_id, client_secret) ctx = ClientContext(site_url).with_credentials(credentials) with open(file_path, "rb") as f: file_content = f.read() target_folder = ctx.web.get_folder_by_server_relative_url(folder_url) file_name = os.path.basename(file_path) uploaded_file = target_folder.upload_file(file_name, file_content).execute_query() Continue reading...