Class: DropboxApi::Endpoints::Files::GetPreview

Inherits:
ContentDownload show all
Defined in:
lib/dropbox_api/endpoints/files/get_preview.rb

Constant Summary collapse

Method =
:post
Path =
'/2/files/get_preview'
ResultType =
DropboxApi::Metadata::File
ErrorType =
DropboxApi::Errors::PreviewError

Instance Method Summary collapse

Methods inherited from ContentDownload

#build_connection, #build_request, #perform_request

Methods inherited from Base

add_endpoint, #initialize

Constructor Details

This class inherits a constructor from DropboxApi::Endpoints::Base

Instance Method Details

#get_preview(path, &block) ⇒ Object

Get a preview for a file. Currently previews are only generated for the files with the following extensions: .doc, .docx, .docm, .ppt, .pps, .ppsx, .ppsm, .pptx, .pptm, .xls, .xlsx, .xlsm, .rtf

Parameters:

  • path (String)

    The path of the file to preview.



14
15
16
# File 'lib/dropbox_api/endpoints/files/get_preview.rb', line 14

add_endpoint :get_preview do |path, &block|
  perform_request({path: path}, &block)
end