



import pathlibįolder = pathlib.Path( ".") # located in this folderįilepath = folder / filename # path object, defining the file # target location in Dropbox Note I think the current API documentation has a small error which sparkandshine has corrected. I wanted to upload a file and create a share link for it, which I could email to users. Here’s my approach using API v2 (and Python 3). Response = client.put_file( '/magnum-opus.txt', f)į, metadata = client.get_file_and_metadata( '/magnum-opus.txt') Print 'linked account: ', client.account_info() Then click the “generate access token” button and cut/paste into the python example below in place of : Folder access as “My app needs access to files already on Dropbox”. Type of data access as “Files & Datastores”Ĭ. Just for the record I created my App with the following:ī. Make sure you install the dropbox module first of course, pip install dropbox.Ĭreate an app under your own dropbox account in the “App Console”. Thanks to for the answer above! I just wanted to clarify for anyone else trying to do this. See the answer of for current API version solution Important Note: this answer is deprecated since dropbox uses v2 API now.
