cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API Lookup Error

API Lookup Error

af11
Explorer | Level 4

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

3 Replies 3

Brogers
Dropbox Staff

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

af11
Explorer | Level 4

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.

Screenshot (41)_LI.jpgWhy is Dropbox asking to access my contacts?  That has nothing to do with the app I built.

Greg-DB
Dropbox Staff

@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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    af11 Explorer | Level 4
  • User avatar
    Brogers Dropbox Staff
What do Dropbox user levels mean?