Class: DropboxApi::Endpoints::Files::SaveUrl

Inherits:
Rpc
  • Object
show all
Defined in:
lib/dropbox_api/endpoints/files/save_url.rb

Constant Summary collapse

Method =
:post
Path =
"/2/files/save_url".freeze
ResultType =
DropboxApi::Results::SaveUrlResult
ErrorType =
DropboxApi::Errors::SaveUrlError

Instance Method Summary collapse

Methods inherited from Rpc

#build_request, #initialize, #request_body

Methods inherited from Base

add_endpoint

Constructor Details

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

Instance Method Details

#save_url(path, url) ⇒ Object

Save a specified URL into a file in user's Dropbox. If the given path already exists, the file will be renamed to avoid the conflict (e.g. myfile (1).txt).

Parameters:

  • path (String)

    The path in Dropbox where the URL will be saved to.

  • url (String)

    The URL to be saved.

Returns:

  • Either the saved file or a reference to the async job.



15
16
17
18
19
20
# File 'lib/dropbox_api/endpoints/files/save_url.rb', line 15

add_endpoint :save_url do |path, url|
  perform_request({
    :path => path,
    :url => url
  })
end