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: 

Re: BUG - Direct link to files created via /media API call return a corrupt URL!

BUG - Direct link to files created via /media API call return a corrupt URL!

De L.1
Collaborator | Level 9

I noticed that direct links generated via the /media API are currently returning a corrupt URL. Not all file formats seem to be affected, but I can reproduce the issue for PDF and Office files.
According to the documentation, the returned JSON should look like this:

{
    "url": "https://dl.dropboxusercontent.com/1/view/abcdefghijk/example",
    "expires": "Fri, 16 Sep 2011 01:01:25 +0000"
}

However, currently the following JSON is returned:

{
    "url": "https://api-content.dropbox.com/1/files/auto/abcdefghijk/example.pdf?signature=1.uJpbEgcWOjAIBQ..1435610003.qbYUOzANtu_33g6uv6dJy0JcV9tjp-oF8nQCci_h2Mg",
    "expires": "Fri, 16 Sep 2011 01:01:25 +0000"
}

The url however is invalid and give the following error:

{"error": "Signature did not match. STRING_TO_SIGN was u'1\\nuJpbEgcWOjAIBQ\\n\\n1435610160\\napi-content.dropbox.com\\nGET\\n/1/files/auto/abcdefghijk/example.pdf'"}

Has something changed in the API or is it a (quite severe) bug. If the /media call has changed, where can I find more information about this?

11 Replies 11

De L.1
Collaborator | Level 9

I am not sure if this is going off topic, we can also discuss it via email.

The app I created is a WordPress plugin allowing users to display their Dropbox files directly on a WordPress page without the need of shared links. Users that want to download a file, don't get their hands on a shared link, but instead the short lived url is used to download the file.

I have the same kind of plugins for Google Drive, Box and OneDrive and their API's all include a (short lived) direct download link to the file. And honestly, I think that it should be part of the Dropbox API as well. I don't see a reason why I should first download files to the apps server via the /files call before I can pass it to the user. It makes more sense to let the user download the file directly via the Dropbox servers.

Greg-DB
Dropbox Staff

That's certainly a reasonable request, and I've sent it along to the right people as a feature request.

Need more support?