echosign 1.0.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.rubocop.yml +14 -0
- data/.rubocop_todo.yml +241 -0
- data/.simplecov +2 -0
- data/.travis.yml +9 -0
- data/Gemfile +3 -3
- data/Gemfile.lock +74 -48
- data/README.md +43 -8
- data/Rakefile +2 -2
- data/doc/Echosign.html +135 -0
- data/doc/Echosign/Agreement.html +545 -0
- data/doc/Echosign/Client.html +5365 -0
- data/doc/Echosign/CounterSignerInfo.html +267 -0
- data/doc/Echosign/Credentials.html +1053 -0
- data/doc/Echosign/Fileinfo.html +305 -0
- data/doc/Echosign/FormFieldLocation.html +264 -0
- data/doc/Echosign/MegaSign.html +533 -0
- data/doc/Echosign/ParameterError.html +124 -0
- data/doc/Echosign/PhoneInfo.html +281 -0
- data/doc/Echosign/Recipient.html +311 -0
- data/doc/Echosign/RecipientSecurityOption.html +296 -0
- data/doc/Echosign/Refresh.html +288 -0
- data/doc/Echosign/Reminder.html +279 -0
- data/doc/Echosign/Request.html +5289 -0
- data/doc/Echosign/Request/EndpointHash.html +328 -0
- data/doc/Echosign/Request/Failure.html +290 -0
- data/doc/Echosign/RequestFormField.html +244 -0
- data/doc/Echosign/RequiredParameterError.html +124 -0
- data/doc/Echosign/UrlFileInfo.html +297 -0
- data/doc/Echosign/User.html +422 -0
- data/doc/Echosign/Validatable.html +355 -0
- data/doc/Echosign/Widget.html +924 -0
- data/doc/Echosign/WidgetCompletionInfo.html +323 -0
- data/doc/Echosign/WidgetPersonalization.html +330 -0
- data/doc/Echosign/WidgetSecurityOption.html +361 -0
- data/doc/Echosign/WidgetSignerSecurityOption.html +298 -0
- data/doc/Echosign/WidgetStatus.html +316 -0
- data/doc/Echosign/WidgetVaultingInfo.html +267 -0
- data/doc/_index.html +378 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +191 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +191 -0
- data/doc/js/app.js +292 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1035 -0
- data/doc/top-level-namespace.html +110 -0
- data/echosign.gemspec +18 -20
- data/features/support/env.rb +8 -8
- data/fixtures/vcr_cassettes/agreement_combined_pdf.yml +2 -2
- data/fixtures/vcr_cassettes/agreement_document_file.yml +1 -1
- data/fixtures/vcr_cassettes/agreement_documents.yml +2 -2
- data/fixtures/vcr_cassettes/agreement_form_data.yml +1 -1
- data/fixtures/vcr_cassettes/agreement_info.yml +1 -1
- data/fixtures/vcr_cassettes/agreement_signing_urls.yml +1 -1
- data/fixtures/vcr_cassettes/audit_trail_pdf.yml +1 -1
- data/fixtures/vcr_cassettes/cancel_agreement.yml +1 -1
- data/fixtures/vcr_cassettes/create_agreement.yml +1 -1
- data/fixtures/vcr_cassettes/create_reminder.yml +1 -1
- data/fixtures/vcr_cassettes/create_transient_document.yml +1 -1
- data/fixtures/vcr_cassettes/create_user.yml +1 -1
- data/fixtures/vcr_cassettes/create_widget.yml +1 -1
- data/fixtures/vcr_cassettes/get_agreements.yml +1 -1
- data/fixtures/vcr_cassettes/get_library_document.yml +1 -1
- data/fixtures/vcr_cassettes/get_library_document_data.yml +1 -1
- data/fixtures/vcr_cassettes/get_library_document_file.yml +1 -1
- data/fixtures/vcr_cassettes/get_library_documents.yml +1 -1
- data/fixtures/vcr_cassettes/get_token.yml +22 -20
- data/fixtures/vcr_cassettes/get_user.yml +1 -1
- data/fixtures/vcr_cassettes/get_users.yml +2 -2
- data/fixtures/vcr_cassettes/get_widget.yml +1 -1
- data/fixtures/vcr_cassettes/get_widget_document_file.yml +1 -1
- data/fixtures/vcr_cassettes/get_widget_documents.yml +1 -1
- data/fixtures/vcr_cassettes/get_widgets.yml +1 -1
- data/fixtures/vcr_cassettes/library_combined_document.yml +2 -2
- data/fixtures/vcr_cassettes/library_document_audit_trail.yml +1 -1
- data/fixtures/vcr_cassettes/personalize_widget.yml +1 -1
- data/fixtures/vcr_cassettes/refresh_token.yml +46 -0
- data/fixtures/vcr_cassettes/revoke_token.yml +44 -0
- data/fixtures/vcr_cassettes/update_widget_status.yml +1 -1
- data/lib/echosign.rb +11 -11
- data/lib/echosign/agreement.rb +26 -10
- data/lib/echosign/agreement/client.rb +111 -104
- data/lib/echosign/agreement/fileinfo.rb +1 -3
- data/lib/echosign/agreement/form_field_location.rb +2 -3
- data/lib/echosign/agreement/phone_info.rb +5 -5
- data/lib/echosign/agreement/recipient.rb +9 -8
- data/lib/echosign/agreement/recipient_security_option.rb +5 -4
- data/lib/echosign/agreement/request.rb +33 -43
- data/lib/echosign/agreement/request_form_field.rb +2 -3
- data/lib/echosign/agreement/url_file_info.rb +8 -6
- data/lib/echosign/client.rb +33 -24
- data/lib/echosign/credentials.rb +95 -24
- data/lib/echosign/library_documents/client.rb +18 -23
- data/lib/echosign/library_documents/request.rb +19 -20
- data/lib/echosign/mega_sign.rb +20 -10
- data/lib/echosign/mega_sign/client.rb +109 -104
- data/lib/echosign/mega_sign/request.rb +32 -43
- data/lib/echosign/refresh.rb +6 -10
- data/lib/echosign/reminder.rb +2 -2
- data/lib/echosign/request.rb +85 -75
- data/lib/echosign/user.rb +13 -7
- data/lib/echosign/validatable.rb +6 -10
- data/lib/echosign/version.rb +1 -1
- data/lib/echosign/widget.rb +53 -27
- data/lib/echosign/widget/client.rb +33 -36
- data/lib/echosign/widget/counter_signer_info.rb +4 -5
- data/lib/echosign/widget/request.rb +28 -52
- data/lib/echosign/widget/widget_completion_info.rb +22 -12
- data/lib/echosign/widget/widget_personalization.rb +9 -7
- data/lib/echosign/widget/widget_security_option.rb +21 -11
- data/lib/echosign/widget/widget_signer_security_option.rb +8 -6
- data/lib/echosign/widget/widget_status.rb +10 -8
- data/lib/echosign/widget/widget_vaulting_info.rb +4 -5
- data/spec/lib/agreement/client_spec.rb +25 -31
- data/spec/lib/client_spec.rb +15 -18
- data/spec/lib/credentials_spec.rb +48 -0
- data/spec/lib/library_documents/client_spec.rb +11 -15
- data/spec/lib/shared_client.rb +9 -16
- data/spec/lib/user_spec.rb +0 -2
- data/spec/lib/validatable_spec.rb +12 -18
- data/spec/lib/version_spec.rb +1 -1
- data/spec/lib/widget/client_spec.rb +46 -49
- data/spec/spec_helper.rb +12 -5
- metadata +125 -60
- data/spec/lib/request_spec.rb +0 -18
@@ -1,22 +1,22 @@
|
|
1
1
|
module Echosign
|
2
|
-
|
3
|
-
class Client
|
4
|
-
|
2
|
+
class Client
|
5
3
|
# Retrieves library documents metadata for a user.
|
6
4
|
#
|
7
|
-
# @param user_id [String] The ID of the user whose library documents are being requested.
|
8
|
-
# @param user_email [String] The email address of the user whose library documents are being requested. If both
|
5
|
+
# @param user_id [String] The ID of the user whose library documents are being requested.
|
6
|
+
# @param user_email [String] The email address of the user whose library documents are being requested. If both
|
7
|
+
# user_id and user_email are provided then user_id is given preference. If neither is specified then the user
|
8
|
+
# is inferred from the access token.
|
9
9
|
# @return [Hash] Library documents metadata
|
10
|
-
def get_library_documents(user_id=nil, user_email=nil)
|
11
|
-
|
10
|
+
def get_library_documents(user_id = nil, user_email = nil)
|
11
|
+
request(:get_library_documents, user_id, user_email)
|
12
12
|
end
|
13
13
|
|
14
|
-
# Retrieves library document metadata
|
14
|
+
# Retrieves library document metadata
|
15
15
|
#
|
16
16
|
# @param library_document_id [String] (REQUIRED)
|
17
17
|
# @return [Hash] Library document metadata
|
18
18
|
def get_library_document(library_document_id)
|
19
|
-
|
19
|
+
request(:get_library_document, library_document_id)
|
20
20
|
end
|
21
21
|
|
22
22
|
# Retrieves library document files metadata
|
@@ -24,7 +24,7 @@ module Echosign
|
|
24
24
|
# @param library_document_id [String] (REQUIRED)
|
25
25
|
# @return [Hash] Library document files metadata
|
26
26
|
def get_library_document_files(library_document_id)
|
27
|
-
|
27
|
+
request(:get_library_document_files, library_document_id)
|
28
28
|
end
|
29
29
|
|
30
30
|
# Retrieves library document file data
|
@@ -33,8 +33,8 @@ module Echosign
|
|
33
33
|
# @param file_id [String] (REQUIRED)
|
34
34
|
# @param file_path [String] File path for saving the document. If none is given, nothing will be saved to disk.
|
35
35
|
# @return [String] Raw library document file data
|
36
|
-
def get_library_document_file(library_document_id, file_id, file_path=nil)
|
37
|
-
response =
|
36
|
+
def get_library_document_file(library_document_id, file_id, file_path = nil)
|
37
|
+
response = request(:get_library_document_file, library_document_id, file_id)
|
38
38
|
unless file_path.nil?
|
39
39
|
file = File.new(file_path, 'wb')
|
40
40
|
file.write(response)
|
@@ -48,8 +48,8 @@ module Echosign
|
|
48
48
|
# @param library_document_id (REQUIRED)
|
49
49
|
# @param file_path [String] File path for saving the document. If none is given, nothing will be saved to disk.
|
50
50
|
# @return [String] Raw library document file data
|
51
|
-
def library_document_audit_trail(library_document_id, file_path=nil)
|
52
|
-
response =
|
51
|
+
def library_document_audit_trail(library_document_id, file_path = nil)
|
52
|
+
response = request(:library_document_audit_trail, library_document_id)
|
53
53
|
unless file_path.nil?
|
54
54
|
file = File.new(file_path, 'wb')
|
55
55
|
file.write(response)
|
@@ -62,10 +62,11 @@ module Echosign
|
|
62
62
|
#
|
63
63
|
# @param library_document_id (REQUIRED)
|
64
64
|
# @param file_path [String] File path for saving the document. If none is given, nothing will be saved to disk.
|
65
|
-
# @param auditReport [Boolean] When set to YES attach an audit report to the library document PDF. Default value
|
65
|
+
# @param auditReport [Boolean] When set to YES attach an audit report to the library document PDF. Default value
|
66
|
+
# will be false.
|
66
67
|
# @return [String] Raw library combined document file data
|
67
|
-
def library_combined_document(library_document_id, file_path=nil, auditReport=false)
|
68
|
-
response =
|
68
|
+
def library_combined_document(library_document_id, file_path = nil, auditReport = false)
|
69
|
+
response = request(:library_combined_document, library_document_id, auditReport)
|
69
70
|
unless file_path.nil?
|
70
71
|
file = File.new(file_path, 'wb')
|
71
72
|
file.write(response)
|
@@ -73,11 +74,5 @@ module Echosign
|
|
73
74
|
end
|
74
75
|
response
|
75
76
|
end
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
77
|
end
|
81
78
|
end
|
82
|
-
|
83
|
-
|
@@ -1,16 +1,17 @@
|
|
1
1
|
module Echosign::Request
|
2
|
-
|
3
2
|
# Retrieves library documents for a user.
|
4
3
|
#
|
5
4
|
# @param token [String] Auth Token
|
6
|
-
# @param user_id [String] The ID of the user whose library documents are being requested.
|
7
|
-
# @param user_email [String] The email address of the user whose library documents are being requested. If both
|
5
|
+
# @param user_id [String] The ID of the user whose library documents are being requested.
|
6
|
+
# @param user_email [String] The email address of the user whose library documents are being requested. If both
|
7
|
+
# user_id and user_email are provided then user_id is given preference. If neither is specified then the user
|
8
|
+
# is inferred from the access token.
|
8
9
|
# @return [Hash] Library documents metadata
|
9
|
-
def self.get_library_documents(token, user_id=nil, user_email=nil)
|
10
|
+
def self.get_library_documents(token, base_uri, user_id = nil, user_email = nil)
|
10
11
|
headers = { 'Access-Token' => token }
|
11
|
-
headers
|
12
|
-
headers
|
13
|
-
endpoint = ENDPOINT.fetch(:libraryDocument)
|
12
|
+
headers['X-User-Id'] = user_id unless user_id.nil?
|
13
|
+
headers['X-User-Email'] = user_email unless user_email.nil?
|
14
|
+
endpoint = ENDPOINT.fetch(:libraryDocument, base_uri)
|
14
15
|
response = get(endpoint, headers)
|
15
16
|
JSON.parse(response.body)
|
16
17
|
end
|
@@ -20,9 +21,9 @@ module Echosign::Request
|
|
20
21
|
# @param token [String] Auth Token
|
21
22
|
# @param library_document_id [String]
|
22
23
|
# @return [Hash] Library document metadata
|
23
|
-
def self.get_library_document(token, library_document_id)
|
24
|
+
def self.get_library_document(token, base_uri, library_document_id)
|
24
25
|
headers = { 'Access-Token' => token }
|
25
|
-
endpoint = "#{ENDPOINT.fetch(:libraryDocument)}/#{library_document_id}"
|
26
|
+
endpoint = "#{ENDPOINT.fetch(:libraryDocument, base_uri)}/#{library_document_id}"
|
26
27
|
response = get(endpoint, headers)
|
27
28
|
JSON.parse(response.body)
|
28
29
|
end
|
@@ -32,9 +33,9 @@ module Echosign::Request
|
|
32
33
|
# @param token [String] Auth Token
|
33
34
|
# @param library_document_id [String] (REQUIRED)
|
34
35
|
# @return [Hash] Library document files metadata
|
35
|
-
def self.get_library_document_files(token, library_document_id)
|
36
|
+
def self.get_library_document_files(token, base_uri, library_document_id)
|
36
37
|
headers = { 'Access-Token' => token }
|
37
|
-
endpoint = "#{ENDPOINT.fetch(:libraryDocument)}/#{library_document_id}/documents"
|
38
|
+
endpoint = "#{ENDPOINT.fetch(:libraryDocument, base_uri)}/#{library_document_id}/documents"
|
38
39
|
response = get(endpoint, headers)
|
39
40
|
JSON.parse(response.body)
|
40
41
|
end
|
@@ -45,9 +46,9 @@ module Echosign::Request
|
|
45
46
|
# @param library_document_id [String] (REQUIRED)
|
46
47
|
# @param file_id [String] (REQUIRED)
|
47
48
|
# @return [String] Library document file data
|
48
|
-
def self.get_library_document_file(token, library_document_id, file_id)
|
49
|
+
def self.get_library_document_file(token, base_uri, library_document_id, file_id)
|
49
50
|
headers = { 'Access-Token' => token }
|
50
|
-
endpoint = "#{ENDPOINT.fetch(:libraryDocument)}/#{library_document_id}/documents/#{file_id}"
|
51
|
+
endpoint = "#{ENDPOINT.fetch(:libraryDocument, base_uri)}/#{library_document_id}/documents/#{file_id}"
|
51
52
|
response = get(endpoint, headers)
|
52
53
|
end
|
53
54
|
|
@@ -56,9 +57,9 @@ module Echosign::Request
|
|
56
57
|
# @param token [String] Auth Token
|
57
58
|
# @param library_document_id [String] (REQUIRED)
|
58
59
|
# @return [String] Library document file data
|
59
|
-
def self.library_document_audit_trail(token, library_document_id)
|
60
|
+
def self.library_document_audit_trail(token, base_uri, library_document_id)
|
60
61
|
headers = { 'Access-Token' => token }
|
61
|
-
endpoint = "#{ENDPOINT.fetch(:libraryDocument)}/#{library_document_id}/auditTrail"
|
62
|
+
endpoint = "#{ENDPOINT.fetch(:libraryDocument, base_uri)}/#{library_document_id}/auditTrail"
|
62
63
|
response = get(endpoint, headers)
|
63
64
|
end
|
64
65
|
|
@@ -67,12 +68,10 @@ module Echosign::Request
|
|
67
68
|
# @param token [String] Auth Token
|
68
69
|
# @param library_document_id [String] (REQUIRED)
|
69
70
|
# @return [String] Raw library combined document file data
|
70
|
-
def self.library_combined_document(token, library_document_id, auditReport)
|
71
|
+
def self.library_combined_document(token, base_uri, library_document_id, auditReport)
|
71
72
|
headers = { 'Access-Token' => token }
|
72
|
-
endpoint = "#{ENDPOINT.fetch(:libraryDocument)}/#{library_document_id}/combinedDocument"
|
73
|
-
endpoint << add_query(endpoint, "auditReport=#{auditReport}")
|
73
|
+
endpoint = "#{ENDPOINT.fetch(:libraryDocument, base_uri)}/#{library_document_id}/combinedDocument"
|
74
|
+
endpoint << add_query(endpoint, "auditReport=#{auditReport}")
|
74
75
|
response = get(endpoint, headers)
|
75
76
|
end
|
76
|
-
|
77
77
|
end
|
78
|
-
|
data/lib/echosign/mega_sign.rb
CHANGED
@@ -4,7 +4,6 @@ require 'echosign/agreement/recipient'
|
|
4
4
|
|
5
5
|
module Echosign
|
6
6
|
class MegaSign < Hash
|
7
|
-
|
8
7
|
include Validatable
|
9
8
|
|
10
9
|
attr_accessor :user_id, :user_email
|
@@ -14,19 +13,30 @@ module Echosign
|
|
14
13
|
# @param [String] user_id ID of the user whom this megasign is made for
|
15
14
|
# @param [String] user_email Email of the user whom this megasign is made for
|
16
15
|
# @param [Hash] params SYMBOL-referenced Hash containing:
|
17
|
-
# @option params [Array] :fileInfos A list of one or more files (or references to files) that will be sent out
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
# @option params [
|
22
|
-
#
|
23
|
-
|
16
|
+
# @option params [Array] :fileInfos A list of one or more files (or references to files) that will be sent out
|
17
|
+
# for signature. If more than one file is provided, they will be combined into one PDF before being sent out.
|
18
|
+
# Note: Only one of the four parameters in every FileInfo object must be specified. Populate the array with
|
19
|
+
# instances of {Echosign::Fileinfo Echosign::Fileinfo} (REQUIRED)
|
20
|
+
# @option params [Array] :recipientSetInfos A list of one or more recipients. For regular (non-MegaSign)
|
21
|
+
# documents, there is no limit on the number of electronic signatures in a single document. Written signatures
|
22
|
+
# are limited to four per document. This limit includes the sender if the sender's signature is also required.
|
23
|
+
# Populate the array with instances of {Echosign::Recipient Echosign::Recipient} (REQUIRED)
|
24
|
+
# @option params [String] :signatureFlow ['SENDER_SIGNATURE_NOT_REQUIRED' or 'SENDER_SIGNS_LAST' or
|
25
|
+
# 'SENDER_SIGNS_FIRST' or 'SEQUENTIAL' or 'PARALLEL']: Selects the workflow you would like to use - whether
|
26
|
+
# the sender needs to sign before the recipient, after the recipient, or not at all. The possible values for
|
27
|
+
# this variable are SENDER_SIGNATURE_NOT_REQUIRED, SENDER_SIGNS_LAST, SENDER_SIGNS_FIRST, SEQUENTIAL or
|
28
|
+
# PARALLEL. (REQUIRED)
|
29
|
+
# @option params [String] :signatureType ['ESIGN' or 'WRITTEN']: Specifies the type of signature you would like
|
30
|
+
# to request - written or eSignature. The possible values are ESIGN or WRITTEN (REQUIRED)
|
31
|
+
# @option params [String] :name The name of the megasign that will be used to identify it, in emails and on the
|
32
|
+
# website. (REQUIRED)
|
33
|
+
# @return [Echosign::MegaSign]
|
34
|
+
def initialize(user_id = nil, user_email = nil, params)
|
24
35
|
@user_id = user_id
|
25
36
|
@user_email = user_email
|
26
|
-
#TODO (cthomas) barf if user_id or user_email are blank
|
37
|
+
# TODO (cthomas) barf if user_id or user_email are blank
|
27
38
|
require_keys([:signatureType, :recipientSetInfos, :signatureFlow, :fileInfos, :name], params)
|
28
39
|
merge!({ megaSignCreationInfo: params })
|
29
40
|
end
|
30
|
-
|
31
41
|
end # class MegaSign
|
32
42
|
end # module Echosign
|
@@ -1,119 +1,124 @@
|
|
1
1
|
module Echosign
|
2
|
-
|
3
2
|
class Client
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
mega_sign_response = Echosign::Request.create_mega_sign(mega_sign, token, mega_sign.user_id, mega_sign.user_email)
|
3
|
+
# Creates an mega_sign
|
4
|
+
#
|
5
|
+
# @param mega_sign [Echosign::Agreement]
|
6
|
+
# @return [String] Agreement ID
|
7
|
+
def create_mega_sign(mega_sign)
|
8
|
+
mega_sign_response = request(:create_mega_sign, mega_sign, mega_sign.user_id, mega_sign.user_email)
|
11
9
|
puts mega_sign_response.inspect
|
12
10
|
mega_sign_response.fetch("mega_signId")
|
13
|
-
|
14
|
-
|
15
|
-
# Gets list of mega_signs
|
16
|
-
#
|
17
|
-
# @param mega_sign [Echosign::Agreement]
|
18
|
-
# @return [String] Agreement ID
|
19
|
-
def get_mega_signs
|
20
|
-
get_mega_signs_response = Echosign::Request.get_mega_signs(token)
|
21
|
-
get_mega_signs_response.fetch("userAgreementList")
|
22
|
-
end
|
11
|
+
end
|
23
12
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
13
|
+
# Gets list of mega_signs
|
14
|
+
#
|
15
|
+
# @return [Hash] An array of mega sign parent agreements
|
16
|
+
def get_mega_signs
|
17
|
+
get_mega_signs_response = request(:get_mega_signs)
|
18
|
+
get_mega_signs_response.fetch("megaSignList")
|
19
|
+
end
|
31
20
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
request_body = {
|
40
|
-
"value" => "CANCEL",
|
41
|
-
"notifySigner" => notify_signer
|
42
|
-
}
|
43
|
-
request_body.merge!(comment: comment) unless comment.nil?
|
21
|
+
# Gets detailed info on an mega_sign
|
22
|
+
#
|
23
|
+
# @param mega_sign_id [String] ID of mega_sign to retrieve info on.
|
24
|
+
# @return [Hash] Detailed mega_sign info
|
25
|
+
def mega_sign_info(mega_sign_id)
|
26
|
+
request(:mega_sign_info, mega_sign_id)
|
27
|
+
end
|
44
28
|
|
45
|
-
|
46
|
-
|
47
|
-
|
29
|
+
# Cancel mega_sign
|
30
|
+
#
|
31
|
+
# @param mega_sign_id [String] (REQUIRED)
|
32
|
+
# @param notify_signer [Boolean] Whether to notify the signer by email of the cancellation. Default is false.
|
33
|
+
# @param comment [String] Comment regarding this cancellation.
|
34
|
+
# @return [String] Result of the operation
|
35
|
+
def cancel_mega_sign(mega_sign_id, notify_signer = false, comment = nil)
|
36
|
+
request_body = {
|
37
|
+
"value" => "CANCEL",
|
38
|
+
"notifySigner" => notify_signer
|
39
|
+
}
|
40
|
+
request_body[:comment] = comment unless comment.nil?
|
48
41
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
# @param recipient_email [String] The email address of the participant to be used to retrieve documents. (REQUIRED)
|
53
|
-
# @param format [String] Content format of the supported documents. It can have two possible values ORIGINAL or CONVERTED_PDF. (REQUIRED)
|
54
|
-
# @param version_id [String] Version of the mega_sign as provided by mega_sign_info(). If not provided, the latest version of the mega_sign is used.
|
55
|
-
# @return [Array] Documents relating to mega_sign.
|
56
|
-
def mega_sign_documents(mega_sign_id, recipient_email, format, version_id=nil)
|
57
|
-
result = Echosign::Request.mega_sign_documents(token, mega_sign_id, recipient_email, format, version_id)
|
58
|
-
end
|
42
|
+
mega_sign_status_response = request(:update_mega_sign_status, mega_sign_id, request_body)
|
43
|
+
mega_sign_status_response.fetch('result')
|
44
|
+
end
|
59
45
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
end
|
73
|
-
response
|
74
|
-
end
|
46
|
+
# All documents relating to an mega_sign
|
47
|
+
#
|
48
|
+
# @param mega_sign_id [String] (REQUIRED)
|
49
|
+
# @param recipient_email [String] The email address of the participant to be used to retrieve documents. (REQUIRED)
|
50
|
+
# @param format [String] Content format of the supported documents. It can have two possible values ORIGINAL or
|
51
|
+
# CONVERTED_PDF. (REQUIRED)
|
52
|
+
# @param version_id [String] Version of the mega_sign as provided by mega_sign_info(). If not provided, the
|
53
|
+
# latest version of the mega_sign is used.
|
54
|
+
# @return [Array] Documents relating to mega_sign.
|
55
|
+
def mega_sign_documents(mega_sign_id, recipient_email, format, version_id = nil)
|
56
|
+
result = request(:mega_sign_documents, mega_sign_id, recipient_email, format, version_id)
|
57
|
+
end
|
75
58
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
59
|
+
# Retrieve a document file from an mega_sign
|
60
|
+
#
|
61
|
+
# @param mega_sign_id [String] (REQUIRED)
|
62
|
+
# @param document_id [String] (REQUIRED)
|
63
|
+
# @param file_path [String] File path to save the document. If no file path is given, nothing is saved to disk.
|
64
|
+
# @return [String] Raw bytes from document file
|
65
|
+
def mega_sign_document_file(mega_sign_id, document_id, file_path = nil)
|
66
|
+
response = request(:mega_sign_document_file, mega_sign_id, document_id)
|
67
|
+
unless file_path.nil?
|
68
|
+
file = File.new(file_path, 'wb')
|
69
|
+
file.write(response)
|
70
|
+
file.close
|
71
|
+
end
|
72
|
+
response
|
73
|
+
end
|
83
74
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
# @param auditReport [Boolean] When set to YES, attach an audit report to the signed mega_sign PDF. Default value is false
|
92
|
-
# @return [String] Raw bytes from document file
|
93
|
-
def mega_sign_combined_pdf(mega_sign_id, file_path=nil, versionId=nil, participantEmail=nil, attachSupportingDocuments=true, auditReport=false)
|
94
|
-
response = Echosign::Request.mega_sign_combined_pdf(token, mega_sign_id, versionId, participantEmail, attachSupportingDocuments, auditReport)
|
95
|
-
unless file_path.nil?
|
96
|
-
file = File.new(file_path, 'wb')
|
97
|
-
file.write(response)
|
98
|
-
file.close
|
99
|
-
end
|
100
|
-
response
|
101
|
-
end
|
75
|
+
# Retrieves the URL for the eSign page for the current signer(s) of an mega_sign
|
76
|
+
#
|
77
|
+
# @param mega_sign_id [String] (REQUIRED)
|
78
|
+
# @return [Hash] URL information for the eSign page of the mega_sign
|
79
|
+
def mega_sign_signing_urls(mega_sign_id)
|
80
|
+
response = request(:mega_sign_signing_urls, mega_sign_id)
|
81
|
+
end
|
102
82
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
83
|
+
# Gets a single combined PDF document for the documents associated with an mega_sign.
|
84
|
+
#
|
85
|
+
# @param mega_sign_id [String] (REQUIRED)
|
86
|
+
# @param file_path [String] File path to save the document. If no file path is given, nothing is saved to disk.
|
87
|
+
# @param versionId [String] The version identifier of mega_sign as provided by get_mega_sign. If not provided
|
88
|
+
# then latest version will be used
|
89
|
+
# @param participantEmail [String] The email address of the participant to be used to retrieve documents. If
|
90
|
+
# none is given, the auth token will be used to determine the user
|
91
|
+
# @param attachSupportingDocuments [Boolean] When set to YES, attach corresponding supporting documents to the
|
92
|
+
# signed mega_sign PDF. Default value of this parameter is true.
|
93
|
+
# @param auditReport [Boolean] When set to YES, attach an audit report to the signed mega_sign PDF. Default
|
94
|
+
# value is false
|
95
|
+
# @return [String] Raw bytes from document file
|
96
|
+
def mega_sign_combined_pdf(mega_sign_id, file_path = nil, versionId = nil, participantEmail = nil,
|
97
|
+
attachSupportingDocuments = true, auditReport = false)
|
98
|
+
response = request(:mega_sign_combined_pdf, mega_sign_id, versionId, participantEmail, attachSupportingDocuments,
|
99
|
+
auditReport)
|
100
|
+
unless file_path.nil?
|
101
|
+
file = File.new(file_path, 'wb')
|
102
|
+
file.write(response)
|
103
|
+
file.close
|
104
|
+
end
|
105
|
+
response
|
106
|
+
end
|
117
107
|
|
108
|
+
# Retrieves library document audit trail file
|
109
|
+
#
|
110
|
+
# @param mega_sign_id [String] (REQUIRED)
|
111
|
+
# @param file_path [String] File path where to save the CSV file. If no file path is given, nothing is saved to
|
112
|
+
# disk.
|
113
|
+
# @return [String] Raw bytes representing CSV file
|
114
|
+
def mega_sign_form_data(mega_sign_id, file_path = nil)
|
115
|
+
response = request(:mega_sign_form_data, mega_sign_id)
|
116
|
+
unless file_path.nil?
|
117
|
+
file = File.new(file_path, 'wb')
|
118
|
+
file.write(response)
|
119
|
+
file.close
|
120
|
+
end
|
121
|
+
response
|
122
|
+
end
|
118
123
|
end
|
119
124
|
end
|