Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all files and folders in my dropbox using v2 api

I am using Python SDK and would like to retrieve all of my dropbox files and folders.

I am using v2 of Python SDK of Dropbox.

dbx = Dropbox("DROBOX_ACCESS_TOKEN")
response = dbx.files_list_folder("/Apps/Marketing")
for file in response.entries:
    print file.name

However, I get an error:

dropbox.exceptions.ApiError: ApiError('b0479a07aaa5a9b405862ae75cbf135d', ListFolderError(u'path', LookupError(u'not_found', None)))

While Apps folder exists in Dropbox when I login (prob in root folder)

When I try to list with empty path in order to get root folder folders:

response = dbx.files_list_folder("")

the response entries are empty.

How can I retrieve the list of all files and folders in dropbox v2 api?

The token is the one I generated in OAuth 2 settings in dropbox.

and I gave the token App folder access to a folder under Apps called Marketing.

like image 927
Dejell Avatar asked Feb 07 '17 09:02

Dejell


People also ask

How do I see all folders in Dropbox?

See all of your shared Dropbox files and folders Just go to dropbox.com/share—or click Shared in the Dropbox web app sidebar. There, you'll see all of your shared files and folders and can edit any of them directly.

How do I export a list of files from Dropbox?

To export files from your Dropbox storage to a physical disk, click on the Download button in the menu above to copy them to your computer. Then, select and confirm the export destination, and wait for the process to finish.

Does Dropbox have an API?

The Dropbox API allows developers to work with files in Dropbox, including advanced functionality like full-text search, thumbnails, and sharing. The Dropbox API explorer is the easiest way to get started making API calls.

Can you bulk download from Dropbox?

You can download files from Dropbox using the official Dropbox website on your Mac or PC. To download a file, open Dropbox in an internet browser and sign in, then find the file and click the option to download it. There's no limit to how many files you can download from Dropbox.


1 Answers

I am using Python SDK and would like to retrieve all of my dropbox files and folders.
...
and I gave the token App folder access to a folder under Apps called Marketing.

You should have given your app Full Dropbox access type. With App Folder access type, your app is automatically restricted to the corresponding folder under Apps, and hence all paths passed to files_list_folder() running under that app are interpreted relative to your app's dedicated folder.

like image 168
Leon Avatar answered Sep 19 '22 11:09

Leon