cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App 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 command to view file content in web browser

API command to view file content in web browser

Mark M.130
Explorer | Level 4
Go to solution

Hi,

 

I'd like to integrate Dropbox deeply into a web app, and one of the biggest required features is to be able to view the contents of the file in a HTML frame, much like the corrent dropbox.com does when you click to view a file in the browser, and you see the comments on the side as well.

 

Being able to retrieve and list the comments of the viewed file would be a bonus too, but at this point I'm wondering if it's even possible to the file contents as webContent, just like in Google Drive you can do this by accessing the webContentLink.

 

Thanks!

  Mark

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution
The endpoint names in my previous reply are links to the documentation which has more information about each one, but in short:
- download: returns the original file data
- get_preview: returns the data for an HTML or PDF preview for files of supported document types
- get_thumbnail: returns the data for a jpeg or png thumbnail for files of supported image types

View solution in original post

6 Replies 6

Greg-DB
Dropbox Staff
Go to solution

The Dropbox API doesn't offer a way to access file comments, but I'll pass this along as a feature request. 

 

It does offer a few options for accessing file data itself though:

 

The standard way is to get the file data directly from the Dropbox API servers using /2/files/download. (Or, for a preview or thumbnail version of the data, depending on the file type, using /2/files/get_preview or /2/files/get_thumbnail respectively.) These return the file data directly, which you could save and display on your web page.

 

Alternatively, you can get a temporary link to the file data using /2/files/get_temporary_link.

 

Or, for a more permanent link to the Dropbox web site to display the file, you can create a shared link using /2/sharing/create_shared_link_with_settings. It sounds like this might be closest to what you're looking for.

 

(Those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints. )

Mark M.130
Explorer | Level 4
Go to solution

Thanks Greg for the quick response. To clarify, what's the difference between preview, thumbnail and download?

Greg-DB
Dropbox Staff
Go to solution
The endpoint names in my previous reply are links to the documentation which has more information about each one, but in short:
- download: returns the original file data
- get_preview: returns the data for an HTML or PDF preview for files of supported document types
- get_thumbnail: returns the data for a jpeg or png thumbnail for files of supported image types

Mark M.130
Explorer | Level 4
Go to solution

Thanks! Sounds like preview is what I'd need.

milankj
Explorer | Level 3

Did you get to view ur file in web using preview?

Greg-DB
Dropbox Staff

@milankj The /2/files/get_preview endpoint is still a valid way to get preview data for files of supported file types. Apps can use that returned data in their UI as needed. If you have any questions or issues regarding using the API, feel free to open a new thread with the relevant details.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    milankj Explorer | Level 3
  • User avatar
    Mark M.130 Explorer | Level 4
What do Dropbox user levels mean?