cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
If you’ve changed your email address, now's the perfect time to update it on your Dropbox account and we’re here to help! Learn more 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: 

Not found error when creating shared link

Not found error when creating shared link

foongzy
New member | Level 2

Hi all, I have a backend hosted in pythonanywhere that has this code snippet. It basically uploads the file and creates a sharing link from that uploaded file.

 

 

 

dbx = dropbox.Dropbox(dropboxToken)
filename = "/dates/"+request.data['name']
dbx.files_upload(request.data['picture'].read(), filename, mute=True)
getLink = dbx.sharing_create_shared_link(filename, short_url=False, pending_upload=None) ​

 

 

 

 This code used to work for years until 1-2 months ago but now just throws an error:

dropbox.exceptions.ApiError: ApiError('1f0a4024a5c24ad09d3e9bc12d2d0e77', CreateSharedLinkError('path', LookupError('not_found', None)))

 

The file still uploads (I verified in UI) but it somehow can't find that file when trying to create the shared link. As I said, this code worked fine previously and no changes was made in the code. Can anyone help/advise? Thanks.

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20
Go to solution

Hi @foongzy,

It's good idea to dump your var 'filename'. I tried to  reproduce your issue but everything works (despite sharing_create_shared_link is deprecated already). Let's see if the filename is some special case.

 

PS: By the way something aside - it's time to think of moving to use refresh token! No long lived access token is issued already, but only short lived. If you need to reissue your access token, it wouldn't work anymore. Just keep in mind.

View solution in original post

3 Replies 3

Здравко
Legendary | Level 20
Go to solution

Hi @foongzy,

It's good idea to dump your var 'filename'. I tried to  reproduce your issue but everything works (despite sharing_create_shared_link is deprecated already). Let's see if the filename is some special case.

 

PS: By the way something aside - it's time to think of moving to use refresh token! No long lived access token is issued already, but only short lived. If you need to reissue your access token, it wouldn't work anymore. Just keep in mind.

foongzy
New member | Level 2
Go to solution
Hi @Здравко,
Yea, I tried the same code in jupyter notebook and it worked, that's why found it weird. I did more digging and changed sharing_create_shared_link to
sharing_create_shared_link_with_settings and it works now. Not too sure what hidden issues prevented sharing_create_shared_link from working. And yes, I am using refresh token to initialise Dropbox. Thanks for the help and tips!

foongzy
New member | Level 2
Go to solution
Hi @Здравко,

Yea, I tried the same code in jupyter notebook and it worked fine too, not sure what's wrong. I did more digging and changed sharing_create_shared_link to sharing_create_shared_link_with_settings and it works. Not sure what hidden issues prevented the other from working. And yes I am using refresh token. Thanks for the help and tips!
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    foongzy New member | Level 2
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?