cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right 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: 

Download other user dropbox file without my dropbox token

Download other user dropbox file without my dropbox token

johnhesler
New member | Level 2

To download other user dropbox file i use

with open("rc.xlsx", "wb") as f:
    shared_link = "https://www.dropbox.com/s/xx/xx.xlsx?dl=0"
    metadata, res = dbx.sharing_get_shared_link_file(url=shared_link,link_password ='xxxx')
    f.write(res.content)

Even so this is not my file i still need mydropbox token to download it. Is it possible to avoid it ?

dbx = dropbox.Dropbox(mydropbox_token)

 

I also check this but can't acess the solution From https://www.dropbox.com/developers/documentation/python#tutorial

In order to make calls to the API, you'll need an instance of the Dropbox object. To instantiate, pass in the access token for the account you want to link.

1 Reply 1

Здравко
Legendary | Level 20

Hi @johnhesler,

While you are talking for link access, it's possible. 😉 Link is something public and direct accessible. But you have done a mistake in your code. Take in mind that the same link can has different forms. The link you are using in your code is preview link (ends on '?dl=0'). So, it's NOT pointing to actual file, but a page to targeting preview the same  file! In this case you are downloading page's HTML code (did you check it 🙂). To download actual file your link should ends on '?dl=1'. That's it.

Hope this helps.

 

ADD: Actually you don't need to use any API calls (since you know link pointing actual file). Just download it!

 

On other side using 'dbx.sharing_get_shared_link_file' requires user authentication. If you want use this method, then you need valid user authentication, despite doesn't matter who gets authenticated.

Need more support?
Who's talking

Top contributors to this post

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