如何使用 v2 api 列出我的保管箱中的所有文件和文件夹
How to list all files and folders in my dropbox using v2 api
我正在使用 Python SDK 并且想要检索我所有的保管箱文件和文件夹。
我正在使用 Dropbox 的 Python SDK v2。
dbx = Dropbox("DROBOX_ACCESS_TOKEN")
response = dbx.files_list_folder("/Apps/Marketing")
for file in response.entries:
print file.name
但是,我得到一个错误:
dropbox.exceptions.ApiError: ApiError('b0479a07aaa5a9b405862ae75cbf135d', ListFolderError(u'path', LookupError(u'not_found', None)))
当我登录时 Apps 文件夹存在于 Dropbox 中(根文件夹中的概率)
当我尝试列出空路径以获取根文件夹时:
response = dbx.files_list_folder("")
响应条目为空。
如何在 dropbox v2 api 中检索所有文件和文件夹的列表?
令牌是我在 dropbox 的 OAuth 2 设置中生成的令牌。
并且我授予令牌 App 文件夹访问 Apps 下名为 Marketing 的文件夹的权限。
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.
您应该为您的应用提供 Full Dropbox 访问类型。使用 App 文件夹 访问类型,您的应用会自动限制在 Apps
下的相应文件夹中,因此所有路径都会传递到 files_list_folder()
运行 下的相应文件夹应用程序相对于您应用程序的专用文件夹进行解释。
dbx = Dropbox("DROBOX_ACCESS_TOKEN")
response = dbx.files_list_folder(path=DROPBOX_INPUT_PATH)
print(response)
我正在使用 Python SDK 并且想要检索我所有的保管箱文件和文件夹。
我正在使用 Dropbox 的 Python SDK v2。
dbx = Dropbox("DROBOX_ACCESS_TOKEN")
response = dbx.files_list_folder("/Apps/Marketing")
for file in response.entries:
print file.name
但是,我得到一个错误:
dropbox.exceptions.ApiError: ApiError('b0479a07aaa5a9b405862ae75cbf135d', ListFolderError(u'path', LookupError(u'not_found', None)))
当我登录时 Apps 文件夹存在于 Dropbox 中(根文件夹中的概率)
当我尝试列出空路径以获取根文件夹时:
response = dbx.files_list_folder("")
响应条目为空。
如何在 dropbox v2 api 中检索所有文件和文件夹的列表?
令牌是我在 dropbox 的 OAuth 2 设置中生成的令牌。
并且我授予令牌 App 文件夹访问 Apps 下名为 Marketing 的文件夹的权限。
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.
您应该为您的应用提供 Full Dropbox 访问类型。使用 App 文件夹 访问类型,您的应用会自动限制在 Apps
下的相应文件夹中,因此所有路径都会传递到 files_list_folder()
运行 下的相应文件夹应用程序相对于您应用程序的专用文件夹进行解释。
dbx = Dropbox("DROBOX_ACCESS_TOKEN")
response = dbx.files_list_folder(path=DROPBOX_INPUT_PATH)
print(response)