I am still trying to get over the initial "hump" writing my first Python Dropbox API. Eventually I would like to iterate through all the folders in a Dropbox account, then for each of those folders, iterate through all the image (JPG) files, writing any comments the user entered to a flat (text) file.
But baby steps first. I can't even get the files_list_folder method to work! Help, please!
My code:
print("Initializing Dropbox API...")
from dropbox import Dropbox
dbx = Dropbox("[appl id]")
result = dbx.files_list_folder('')
Output:
Initializing Dropbox API...
Traceback (most recent call last):
File "G:\pythonProject1\main.py", line 10, in <module>
result = dbx.files_list_folder('')
File "C:\Users\camorgan_2\AppData\Local\Programs\Python\Python39\lib\site-packages\dropbox\base.py", line 1952, in files_list_folder
r = self.request(
File "C:\Users\camorgan_2\AppData\Local\Programs\Python\Python39\lib\site-packages\dropbox\dropbox_client.py", line 323, in request res = self.request_json_string_with_retry(host,
File "C:\Users\camorgan_2\AppData\Local\Programs\Python\Python39\lib\site-packages\dropbox\dropbox_client.py", line 479, in request
_json_string_with_retry
return self.request_json_string(host,
File "C:\Users\camorgan_2\AppData\Local\Programs\Python\Python39\lib\site-packages\dropbox\dropbox_client.py", line 604, in request _json_string
raise BadInputError(request_id, r.text)
dropbox.exceptions.BadInputError: BadInputError('553b370bfef7427db853a0aa8b1b9bae', 'Error in call to API function "files/list_folder
": The given OAuth 2 access token is malformed.')