Until the other day I was able to read files using the dropbox API, but now I get an authentication error.
!pip install dropbox
import dropbox
import time
dbx = dropbox.Dropbox(<Access Token>)
dir = <folder_path>
lists = []
def __get_files_recursive(res):
for entry in res.entries:
##print(list(entry.path_display.split(",")))
lists.append(entry.path_display.split(","))
##print(lists)
print(entry.path_display)
if (res.has_more):
res2 = dbx.files_list_folder_continue(res.cursor)
__get_files_recursive(res2)
res = dbx.files_list_folder(dir, recursive=True)
__get_files_recursive(res)
Error Code was as follows
---------------------------------------------------------------------------
BadInputException Traceback (most recent call last)
<ipython-input-64-f64dcbce5290> in <module>()
12 __get_files_recursive(res2)
13
---> 14 res = dbx.files_list_folder(dir, recursive=True)
15 __get_files_recursive(res)
3 frames
/usr/local/lib/python3.7/dist-packages/dropbox/dropbox_client.py in request_json_string(self, host, func_name, route_style, request_json_arg, auth_type, request_binary, timeout)
562 pass
563 else:
--> 564 raise BadInputException('Unhandled auth type: {}'.format(auth_type))
565
566 # The contents of the body of the HTTP request
BadInputException: Unhandled auth type: app, user
If you know how to solve this problem, please let me know.