Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I have an app that is connected to my dropbox account with a webhook and sends an alert each time something is changed in certain folders. For some reason, I am getting the following error when I make changes to files in the account
dropbox.exceptions.ApiError: ApiError('8fe4838db3874737b55c0d7e3935585e', ListFolderError('path', LookupError('unsupported_content_type', None)))
The following is the code running in which this error is happening:
def process_user(account, access_token, refresh_token):
# cursor for the user (None the first time)
cursor = redis_client.hget('cursors', account)
dbx = Dropbox(
oauth2_access_token=access_token,
oauth2_refresh_token=refresh_token,
app_key=APP_KEY,
app_secret=APP_SECRET
)
print('PROCESS USER IS RUNNING')
has_more = True
while has_more:
if cursor is None:
result = dbx.files_list_folder(path='', recursive=True, include_non_downloadable_files=True)
else:
result = dbx.files_list_folder_continue(cursor)
for entry in result.entries:
if filter_notifications(entry):
if isinstance(entry, FileMetadata):
send_notification('File Metadat')
elif isinstance(entry, DeletedMetadata):
send_notification('DeletedMetadata')
elif isinstance(entry, FolderMetadata):
send_notification('Folder Metadata')
else:
send_notification('Something happened, not sure what...')
# Update cursor
cursor = result.cursor
redis_client.hset('cursors', account, cursor)
# Repeat only if there's more to do
has_more = result.has_more
Please advise what could be wrong. Thank you for your help
Hello @af11 ,
I see that the error you are receiving appears to be a lookup error indicating you are trying to access an unsupported content type. Can you please reply with what changes you are making in the account that cause this issue as well as the file types you are working with?
Can you also validate that you are passing in a valid access token and refresh token? For security reasons, please do not paste them here but just validate that they are passed in and not null. The `list_folder` endpoint supports both user and app auth. When no access token is present, it will attempt to use the app key and secret to authenticate which only works on shared links which could explain the issue you are running into.
Can you also include the line in which you are receiving this error?
Thanks,
Brad
Thank you, it seems that the access and refresh tokens were actually not being passed in properly.
On a different note, when I use the OAuth flow to authorize connecting a Dropbox account to this app, I think something is insecure about it.
Why is Dropbox asking to access my contacts? That has nothing to do with the app I built.
@af11 Thanks for following up. I'm glad to hear you got that working.
Your new question seems to be related to using Google to sign in to Dropbox, and the level of access used in that flow. We can only help with the Dropbox API itself here, so I recommend opening a thread in the accounts section of the forum or contacting support for that instead.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!