You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

brookesteele's avatar
brookesteele
New member | Level 2
4 years ago

API doesn't allow shared links from not owner

I have a python script to pull and process team data where the I (a.k.a. developer) processes data using a shared link pasted in by a team member.  The goal is to process data supplied by team on a server.  Fun fact.  I can only process data using a public shared link that I created.    What permissions/settings are required so that I can pull data using the api and a shared link that I didn't personally create?  Why are permissions on public links overridden by API?  I can access the data from the links if I don't use the API, but that defeats the purpose.  I've tried modifying the shared link settings, but neither I nor the team admin are authorized to do this.

 

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Using the Dropbox API v2 Python SDK, you should be able to use the sharing_get_shared_link_metadata and sharing_get_shared_link_file/sharing_get_shared_link_file_to_file methods to get the metadata and file data, respectively, from a shared link, as long as the links settings allow it (e.g., it's publicly accessible), even if you're not using an access token for the shared link owner.

     

    Could you share the relevant code you're running and the error/output you're getting so I can take a look and get a better idea of specifically what's not working for you? It may be helpful if you can share a sample shared link, but please don't share any access tokens. Thanks!

    • brookesteele's avatar
      brookesteele
      New member | Level 2

      My solution was to use  the force download option of my shared link and just download it w/o using the dropbox api.  In my case, the api is unnecessary.    

      import requests

      ...

      force_link =external_link.replace('=0', '=1')
      r = requests.get(force_link, stream=True)
      with open(dest_file, "wb") as video:
      for chunk in r.iter_content(chunk_size=1024):
      if chunk:
      video.write(chunk)
      return