5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/dropbox/web_client/actions.rb', line 5
def invite(path, emails, message = "", is_shared_folder = nil)
ensure_authenticated
if is_shared_folder.nil?
share_options_response = share_options(path)
is_shared_folder = !share_options_response.error?
end
params = {
"emails" => emails.join(","),
"custom_message" => message,
"t" => cookies.login_token,
"_subject_uid" => subject_uid
}
if is_shared_folder
url = invite_more_url
params["ns_id"] = share_options(path).response_data[:ns_id]
else
url = invite_url
params["path"] = path
end
response = RestClient.post(url, params, {:cookies => cookies.all})
response_text = response.body
return ResponseParser.new(response_text)
end
|