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: 

API to get content hash of shared file link

API to get content hash of shared file link

overlookmotel
Explorer | Level 3

Hi.

 

Is there an API endpoint to get the content hash of a file received as a shared link?

 

Where the shared link is to a folder, it's possible with:

 

sharing/get_shared_link_metadata { "url": "https://www.dropbox.com/s/..." }

then

files/list_folder { shared_link: { "url": "https://www.dropbox.com/s/..." }, path: '/path/to/folder' }

 
The result from files/list_folder contains the content_hash field for each file.
 
However, if the shared link is to a file, not a folder, I can't find any way to obtain the content_hash for that file from the API.
 
Therefore, to ensure files are downloaded without corruption, I have to download everything twice and compare the hashes of the two copies - which is a waste of bandwidth for both me and Dropbox.
 
It would be great if this was available through the API. Perhaps it is and I can't find the right endpoint.
3 Replies 3

Greg-DB
Dropbox Staff

No, unfortunately API doesn't offer a way to get the content hash for a file given just a shared link to the file itself from another account, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. 

overlookmotel
Explorer | Level 3

Thanks Greg.

 

It would be very valuable to be able to retrieve this information from the API. As I mentioned, currently we have to download everything twice and hash-check the two copies against each other to ensure no corruption, which is waste of bandwidth on both sides.

Greg-DB
Dropbox Staff

Thanks for following up with the additional feedback.

 

By the way though, since Dropbox enforces TLS (i.e., it will redirect any http:// shared link URLs to https://), I believe you can technically rely on TLS to ensure integrity of the download against any corruption in transit. The TLS specification states:

The primary goal of the TLS Protocol is to provide privacy and data integrity between two communicating applications.
The connection is reliable. Message transport includes a message integrity check using a keyed MAC.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    overlookmotel Explorer | Level 3
What do Dropbox user levels mean?