Class: DropboxApi::Endpoints::Sharing::AddFolderMember

Inherits:
Rpc
  • Object
show all
Includes:
OptionsValidator
Defined in:
lib/dropbox_api/endpoints/sharing/add_folder_member.rb

Constant Summary collapse

Method =
:post
Path =
"/2/sharing/add_folder_member".freeze
ResultType =
DropboxApi::Results::VoidResult
ErrorType =
DropboxApi::Errors::AddFolderMemberError

Instance Method Summary collapse

Methods included from OptionsValidator

#validate_options

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

#add_folder_member(folder_id, members, options = {}) ⇒ Object

Allows an owner or editor (if the ACL update policy allows) of a shared folder to add another member.

For the new member to get access to all the functionality for this folder, you will need to call mount_folder on their behalf.

Apps must have full Dropbox access to use this endpoint.

The members parameter can be an Array or a single member element. Each element is represented by either a String or a Metadata::AddMember object. This parameter can be just a string with an email.

You can also build a Metadata::AddMember object and use it in the members parameter, this allows custom options for each member.

Examples:

client = DropboxApi::Client.new
client.add_folder_member "1363389221", "[email protected]"

Parameters:

  • folder_id (String)

    The ID for the shared folder.

  • members (Array<AddMember,String>)

    The intended list of members to add. Added members will receive invites to join the shared folder.

Options Hash (options):

  • quiet (Boolean)

    Whether added members should be notified via email and device notifications of their invite. The default for this field is False.

  • custom_message (String)

    Optional message to display to added members in their invitation. This field is optional.

See Also:



38
39
40
41
42
43
44
45
46
47
# File 'lib/dropbox_api/endpoints/sharing/add_folder_member.rb', line 38

add_endpoint :add_folder_member do |folder_id, members, options = {}|
  validate_options([:quiet, :custom_message], options)
  options[:quiet] ||= false
  options[:custom_message] ||= nil

  perform_request options.merge({
    :shared_folder_id => folder_id.to_s,
    :members => build_members_param(members)
  })
end