-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathSignatureRequestSendWithTemplateExample.rb
More file actions
64 lines (53 loc) · 1.96 KB
/
SignatureRequestSendWithTemplateExample.rb
File metadata and controls
64 lines (53 loc) · 1.96 KB
1
2
3
4
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
require "json"
require "dropbox-sign"
Dropbox::Sign.configure do |config|
config.username = "YOUR_API_KEY"
# config.access_token = "YOUR_ACCESS_TOKEN"
end
signing_options = Dropbox::Sign::SubSigningOptions.new
signing_options.default_type = "draw"
signing_options.draw = true
signing_options.phone = false
signing_options.type = true
signing_options.upload = true
signing_options.force_advanced_signature_details = false
signers_1 = Dropbox::Sign::SubSignatureRequestTemplateSigner.new
signers_1.role = "Client"
signers_1.name = "George"
signers_1.email_address = "george@example.com"
signers = [
signers_1,
]
ccs_1 = Dropbox::Sign::SubCC.new
ccs_1.role = "Accounting"
ccs_1.email_address = "accounting@example.com"
ccs = [
ccs_1,
]
custom_fields_1 = Dropbox::Sign::SubCustomField.new
custom_fields_1.name = "Cost"
custom_fields_1.editor = "Client"
custom_fields_1.required = true
custom_fields_1.value = "$20,000"
custom_fields = [
custom_fields_1,
]
signature_request_send_with_template_request = Dropbox::Sign::SignatureRequestSendWithTemplateRequest.new
signature_request_send_with_template_request.template_ids = [
"61a832ff0d8423f91d503e76bfbcc750f7417c78",
]
signature_request_send_with_template_request.message = "Glad we could come to an agreement."
signature_request_send_with_template_request.subject = "Purchase Order"
signature_request_send_with_template_request.test_mode = true
signature_request_send_with_template_request.signing_options = signing_options
signature_request_send_with_template_request.signers = signers
signature_request_send_with_template_request.ccs = ccs
signature_request_send_with_template_request.custom_fields = custom_fields
begin
response = Dropbox::Sign::SignatureRequestApi.new.signature_request_send_with_template(
signature_request_send_with_template_request,
)
p response
rescue Dropbox::Sign::ApiError => e
puts "Exception when calling SignatureRequestApi#signature_request_send_with_template: #{e}"
end