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
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://
|
5
|
+
uri: https://api.eu1.echosign.com/api/rest/v5/widgets/2AAABLblqZhD_6RpgbZh5ZVlLXz1H1kfVzw4vHB91MtmjNHBDorFqO0H3_cGzBudZxiWNzPXFzOc*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://
|
5
|
+
uri: https://api.eu1.echosign.com/api/rest/v5/widgets/2AAABLblqZhD_6RpgbZh5ZVlLXz1H1kfVzw4vHB91MtmjNHBDorFqO0H3_cGzBudZxiWNzPXFzOc*/documents/2AAABLblqZhCGyGn1bpbXp-Kt-QXX8fsBWhjjO-bUKd0NQ184Xxm-mE6gg0DN0e-3k0Lwj6IPw9Q*
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://
|
5
|
+
uri: https://api.eu1.echosign.com/api/rest/v5/widgets/2AAABLblqZhD_6RpgbZh5ZVlLXz1H1kfVzw4vHB91MtmjNHBDorFqO0H3_cGzBudZxiWNzPXFzOc*/documents
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,10 +2,10 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://
|
5
|
+
uri: https://api.eu1.echosign.com/api/rest/v5/libraryDocuments/2AAABLblqZhAlC4t0c3xAJ92RFv44xFGZhbCuHpalUdpcHW9k72imMEG-W1SYCmUoia1ZNgQZ-FE*/combinedDocument
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
|
-
string: ''
|
8
|
+
string: 'auditReport=true'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- '*/*; q=0.5, application/xml'
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://
|
5
|
+
uri: https://api.eu1.echosign.com/api/rest/v5/libraryDocuments/2AAABLblqZhAlC4t0c3xAJ92RFv44xFGZhbCuHpalUdpcHW9k72imMEG-W1SYCmUoia1ZNgQZ-FE*/auditTrail
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: put
|
5
|
-
uri: https://
|
5
|
+
uri: https://api.eu1.echosign.com/api/rest/v5/widgets/2AAABLblqZhD_6RpgbZh5ZVlLXz1H1kfVzw4vHB91MtmjNHBDorFqO0H3_cGzBudZxiWNzPXFzOc*/personalize
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: '{"email":"cthomas@railjumper.com"}'
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://secure.echosign.com/oauth/refresh
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: client_id=9Q444442AX82M&client_secret=390db09fc6672388b9457593a7&grant_type=refresh_token&refresh_token=3AAABLblqZhCNb-X2YXthBgBsEVpM1xC0EATrsDEo0yAmXOIlM58tuASRzYaMjhUGNbRQga8syqE%2A
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.12.2
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Tue, 11 Sep 2018 23:41:11 GMT
|
25
|
+
Server:
|
26
|
+
- Apache
|
27
|
+
Strict-Transport-Security:
|
28
|
+
- max-age=31536000;
|
29
|
+
X-Xss-Protection:
|
30
|
+
- 1; mode=block
|
31
|
+
X-Content-Type-Options:
|
32
|
+
- nosniff
|
33
|
+
X-Robots-Tag:
|
34
|
+
- none
|
35
|
+
P3p:
|
36
|
+
- CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
|
37
|
+
Transfer-Encoding:
|
38
|
+
- chunked
|
39
|
+
Content-Type:
|
40
|
+
- application/json;charset=UTF-8
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: '{"access_token":"3AAABLblqZhA9xhGH0gLPM8cKzF-pe_Uv_0_w72y8CqySA1kyRLveqY7fWZo_M3GC9u-ogYb3eAnD95YpnnlerKigV6IZHqFZ","token_type":"Bearer","expires_in":3600}'
|
44
|
+
http_version:
|
45
|
+
recorded_at: Tue, 11 Sep 2018 23:41:11 GMT
|
46
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://secure.echosign.com/oauth/revoke
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: token=3AAABLblqZhAN-cxVlpFIUv3XdlgqlyWF8qVbIWnUmmvkAB4u6yPBE50XAqTqzLNCjbWS8QKAZPdgYOaqZHv6EE5LEJOc5NOK
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.12.2
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Wed, 12 Sep 2018 00:53:24 GMT
|
25
|
+
Server:
|
26
|
+
- Apache
|
27
|
+
Content-Length:
|
28
|
+
- '0'
|
29
|
+
Strict-Transport-Security:
|
30
|
+
- max-age=31536000;
|
31
|
+
X-Xss-Protection:
|
32
|
+
- 1; mode=block
|
33
|
+
X-Content-Type-Options:
|
34
|
+
- nosniff
|
35
|
+
X-Robots-Tag:
|
36
|
+
- none
|
37
|
+
P3p:
|
38
|
+
- CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: ''
|
42
|
+
http_version:
|
43
|
+
recorded_at: Wed, 12 Sep 2018 00:53:24 GMT
|
44
|
+
recorded_with: VCR 2.8.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: put
|
5
|
-
uri: https://
|
5
|
+
uri: https://api.eu1.echosign.com/api/rest/v5/widgets/2AAABLblqZhD_6RpgbZh5ZVlLXz1H1kfVzw4vHB91MtmjNHBDorFqO0H3_cGzBudZxiWNzPXFzOc*/status
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: '{"value":"DISABLE","message":"Hey guys, hope you like this widget."}'
|
data/lib/echosign.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require 'json'
|
2
|
-
require "echosign/version"
|
3
|
-
require 'echosign/client'
|
4
|
-
require 'echosign/validatable'
|
5
|
-
require 'echosign/credentials'
|
6
|
-
require 'echosign/refresh'
|
7
|
-
require 'echosign/request'
|
8
|
-
require 'echosign/agreement'
|
9
|
-
require 'echosign/user'
|
10
|
-
require 'echosign/reminder'
|
11
|
-
require 'echosign/widget'
|
1
|
+
require 'json'
|
2
|
+
require "echosign/version"
|
3
|
+
require 'echosign/client'
|
4
|
+
require 'echosign/validatable'
|
5
|
+
require 'echosign/credentials'
|
6
|
+
require 'echosign/refresh'
|
7
|
+
require 'echosign/request'
|
8
|
+
require 'echosign/agreement'
|
9
|
+
require 'echosign/user'
|
10
|
+
require 'echosign/reminder'
|
11
|
+
require 'echosign/widget'
|
data/lib/echosign/agreement.rb
CHANGED
@@ -6,7 +6,6 @@ require 'echosign/agreement/form_field_location'
|
|
6
6
|
|
7
7
|
module Echosign
|
8
8
|
class Agreement < Hash
|
9
|
-
|
10
9
|
include Validatable
|
11
10
|
|
12
11
|
attr_accessor :user_id, :user_email
|
@@ -16,19 +15,36 @@ module Echosign
|
|
16
15
|
# @param [String] user_id ID of the user whom this agreement is made for
|
17
16
|
# @param [String] user_email Email of the user whom this agreement is made for
|
18
17
|
# @param [Hash] params SYMBOL-referenced Hash containing:
|
19
|
-
# @option params [Array] :fileInfos A list of one or more files (or references to files) that will be sent out
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
# @option params [
|
24
|
-
#
|
25
|
-
|
18
|
+
# @option params [Array] :fileInfos A list of one or more files (or references to files) that will be sent out
|
19
|
+
# for signature. If more than one file is provided, they will be combined into one PDF before being sent out.
|
20
|
+
# Note: Only one of the four parameters in every FileInfo object must be specified. Populate the array with
|
21
|
+
# instances of {Echosign::Fileinfo Echosign::Fileinfo} (REQUIRED)
|
22
|
+
# @option params [Array] :recipientSetInfos A list of one or more recipients. For regular (non-MegaSign)
|
23
|
+
# documents, there is no limit on the number of electronic signatures in a single document. Written signatures
|
24
|
+
# are limited to four per document. This limit includes the sender if the sender's signature is also required.
|
25
|
+
# Populate the array with instances of {Echosign::Recipient Echosign::Recipient} (REQUIRED)
|
26
|
+
# @option params [String] :signatureFlow ['SENDER_SIGNATURE_NOT_REQUIRED' or 'SENDER_SIGNS_LAST' or
|
27
|
+
# 'SENDER_SIGNS_FIRST' or 'SEQUENTIAL' or 'PARALLEL']: Selects the workflow you would like to use - whether
|
28
|
+
# the sender needs to sign before the recipient, after the recipient, or not at all. The possible values for
|
29
|
+
# this variable are SENDER_SIGNATURE_NOT_REQUIRED, SENDER_SIGNS_LAST, SENDER_SIGNS_FIRST, SEQUENTIAL or
|
30
|
+
# PARALLEL. (REQUIRED)
|
31
|
+
# @option params [String] :signatureType ['ESIGN' or 'WRITTEN']: Specifies the type of signature you would like
|
32
|
+
# to request - written or eSignature. The possible values are ESIGN or WRITTEN (REQUIRED)
|
33
|
+
# @option params [String] :name The name of the agreement that will be used to identify it, in emails and on the
|
34
|
+
# website. (REQUIRED)
|
35
|
+
# @return [Echosign::Agreement]
|
36
|
+
def initialize(user_id = nil, user_email = nil, params)
|
26
37
|
@user_id = user_id
|
27
38
|
@user_email = user_email
|
28
|
-
#TODO (cthomas) barf if user_id or user_email are blank
|
39
|
+
# TODO (cthomas) barf if user_id or user_email are blank
|
40
|
+
if params.has_key?(:recipients)
|
41
|
+
warn("NOTE: :recipients param in #{self.class}.new is deprecated; use :recipientSetInfos instead.\n" +
|
42
|
+
"#{self.class}.new called from #{Gem.location_of_caller.join(":")}")
|
43
|
+
params = params.dup
|
44
|
+
params[:recipientSetInfos] ||= params.delete :recipients
|
45
|
+
end
|
29
46
|
require_keys([:signatureType, :recipientSetInfos, :signatureFlow, :fileInfos, :name], params)
|
30
47
|
merge!({ documentCreationInfo: params })
|
31
48
|
end
|
32
|
-
|
33
49
|
end # class Agreement
|
34
50
|
end # module Echosign
|
@@ -1,118 +1,125 @@
|
|
1
1
|
module Echosign
|
2
|
-
|
3
2
|
class Client
|
3
|
+
# Creates an agreement
|
4
|
+
#
|
5
|
+
# @param agreement [Echosign::Agreement]
|
6
|
+
# @return [String] Agreement ID
|
7
|
+
def create_agreement(agreement)
|
8
|
+
agreement_response = request(:create_agreement, agreement, agreement.user_id, agreement.user_email)
|
9
|
+
return agreement_response['agreementId'] if agreement_response.has_key?('agreementId')
|
4
10
|
|
5
|
-
|
6
|
-
|
7
|
-
# @param agreement [Echosign::Agreement]
|
8
|
-
# @return [String] Agreement ID
|
9
|
-
def create_agreement(agreement)
|
10
|
-
agreement_response = Echosign::Request.create_agreement(agreement, token, agreement.user_id, agreement.user_email)
|
11
|
-
agreement_response.fetch("agreementId")
|
12
|
-
end
|
13
|
-
|
14
|
-
# Gets list of agreements
|
15
|
-
#
|
16
|
-
# @param agreement [Echosign::Agreement]
|
17
|
-
# @return [String] Agreement ID
|
18
|
-
def get_agreements
|
19
|
-
get_agreements_response = Echosign::Request.get_agreements(token)
|
20
|
-
get_agreements_response.fetch("userAgreementList")
|
21
|
-
end
|
11
|
+
raise "Error creating agreement - response was #{agreement_response}"
|
12
|
+
end
|
22
13
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
14
|
+
# Gets list of agreements
|
15
|
+
#
|
16
|
+
# @return [Hash] An array of user agreement items
|
17
|
+
def get_agreements
|
18
|
+
get_agreements_response = request(:get_agreements)
|
19
|
+
get_agreements_response.fetch("userAgreementList")
|
20
|
+
end
|
30
21
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
request_body = {
|
39
|
-
"value" => "CANCEL",
|
40
|
-
"notifySigner" => notify_signer
|
41
|
-
}
|
42
|
-
request_body.merge!(comment: comment) unless comment.nil?
|
22
|
+
# Gets detailed info on an agreement
|
23
|
+
#
|
24
|
+
# @param agreement_id [String] ID of agreement to retrieve info on.
|
25
|
+
# @return [Hash] Detailed agreement info
|
26
|
+
def agreement_info(agreement_id)
|
27
|
+
request(:agreement_info, agreement_id)
|
28
|
+
end
|
43
29
|
|
44
|
-
|
45
|
-
|
46
|
-
|
30
|
+
# Cancel agreement
|
31
|
+
#
|
32
|
+
# @param agreement_id [String] (REQUIRED)
|
33
|
+
# @param notify_signer [Boolean] Whether to notify the signer by email of the cancellation. Default is false.
|
34
|
+
# @param comment [String] Comment regarding this cancellation.
|
35
|
+
# @return [String] Result of the operation
|
36
|
+
def cancel_agreement(agreement_id, notify_signer = false, comment = nil)
|
37
|
+
request_body = {
|
38
|
+
"value" => "CANCEL",
|
39
|
+
"notifySigner" => notify_signer
|
40
|
+
}
|
41
|
+
request_body[:comment] = comment unless comment.nil?
|
47
42
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
# @param recipient_email [String] The email address of the participant to be used to retrieve documents. (REQUIRED)
|
52
|
-
# @param format [String] Content format of the supported documents. It can have two possible values ORIGINAL or CONVERTED_PDF. (REQUIRED)
|
53
|
-
# @param version_id [String] Version of the agreement as provided by agreement_info(). If not provided, the latest version of the agreement is used.
|
54
|
-
# @return [Array] Documents relating to agreement.
|
55
|
-
def agreement_documents(agreement_id, recipient_email, format, version_id=nil)
|
56
|
-
result = Echosign::Request.agreement_documents(token, agreement_id, recipient_email, format, version_id)
|
57
|
-
end
|
43
|
+
agreement_status_response = request(:update_agreement_status, agreement_id, request_body)
|
44
|
+
agreement_status_response.fetch('result')
|
45
|
+
end
|
58
46
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
end
|
72
|
-
response
|
73
|
-
end
|
47
|
+
# All documents relating to an agreement
|
48
|
+
#
|
49
|
+
# @param agreement_id [String] (REQUIRED)
|
50
|
+
# @param recipient_email [String] The email address of the participant to be used to retrieve documents. (REQUIRED)
|
51
|
+
# @param format [String] Content format of the supported documents. It can have two possible values ORIGINAL or
|
52
|
+
# CONVERTED_PDF. (REQUIRED)
|
53
|
+
# @param version_id [String] Version of the agreement as provided by agreement_info(). If not provided, the
|
54
|
+
# latest version of the agreement is used.
|
55
|
+
# @return [Array] Documents relating to agreement.
|
56
|
+
def agreement_documents(agreement_id, recipient_email, format, version_id = nil)
|
57
|
+
result = request(:agreement_documents, agreement_id, recipient_email, format, version_id)
|
58
|
+
end
|
74
59
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
60
|
+
# Retrieve a document file from an agreement
|
61
|
+
#
|
62
|
+
# @param agreement_id [String] (REQUIRED)
|
63
|
+
# @param document_id [String] (REQUIRED)
|
64
|
+
# @param file_path [String] File path to save the document. If no file path is given, nothing is saved to disk.
|
65
|
+
# @return [String] Raw bytes from document file
|
66
|
+
def agreement_document_file(agreement_id, document_id, file_path = nil)
|
67
|
+
response = request(:agreement_document_file, agreement_id, document_id)
|
68
|
+
unless file_path.nil?
|
69
|
+
file = File.new(file_path, 'wb')
|
70
|
+
file.write(response)
|
71
|
+
file.close
|
72
|
+
end
|
73
|
+
response
|
74
|
+
end
|
82
75
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
# @param auditReport [Boolean] When set to YES, attach an audit report to the signed agreement PDF. Default value is false
|
91
|
-
# @return [String] Raw bytes from document file
|
92
|
-
def agreement_combined_pdf(agreement_id, file_path=nil, versionId=nil, participantEmail=nil, attachSupportingDocuments=true, auditReport=false)
|
93
|
-
response = Echosign::Request.agreement_combined_pdf(token, agreement_id, versionId, participantEmail, attachSupportingDocuments, auditReport)
|
94
|
-
unless file_path.nil?
|
95
|
-
file = File.new(file_path, 'wb')
|
96
|
-
file.write(response)
|
97
|
-
file.close
|
98
|
-
end
|
99
|
-
response
|
100
|
-
end
|
76
|
+
# Retrieves the URL for the eSign page for the current signer(s) of an agreement
|
77
|
+
#
|
78
|
+
# @param agreement_id [String] (REQUIRED)
|
79
|
+
# @return [Hash] URL information for the eSign page of the agreement
|
80
|
+
def agreement_signing_urls(agreement_id)
|
81
|
+
response = request(:agreement_signing_urls, agreement_id)
|
82
|
+
end
|
101
83
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
84
|
+
# Gets a single combined PDF document for the documents associated with an agreement.
|
85
|
+
#
|
86
|
+
# @param agreement_id [String] (REQUIRED)
|
87
|
+
# @param file_path [String] File path to save the document. If no file path is given, nothing is saved to disk.
|
88
|
+
# @param versionId [String] The version identifier of agreement as provided by get_agreement. If not provided
|
89
|
+
# then latest version will be used
|
90
|
+
# @param participantEmail [String] The email address of the participant to be used to retrieve documents. If
|
91
|
+
# none is given, the auth token will be used to determine the user
|
92
|
+
# @param attachSupportingDocuments [Boolean] When set to YES, attach corresponding supporting documents to the
|
93
|
+
# signed agreement PDF. Default value of this parameter is true.
|
94
|
+
# @param auditReport [Boolean] When set to YES, attach an audit report to the signed agreement PDF. Default
|
95
|
+
# value is false
|
96
|
+
# @return [String] Raw bytes from document file
|
97
|
+
def agreement_combined_pdf(agreement_id, file_path = nil, versionId = nil, participantEmail = nil,
|
98
|
+
attachSupportingDocuments = true, auditReport = false)
|
99
|
+
response = request(:agreement_combined_pdf, agreement_id, versionId, participantEmail, attachSupportingDocuments,
|
100
|
+
auditReport)
|
101
|
+
unless file_path.nil?
|
102
|
+
file = File.new(file_path, 'wb')
|
103
|
+
file.write(response)
|
104
|
+
file.close
|
105
|
+
end
|
106
|
+
response
|
107
|
+
end
|
116
108
|
|
109
|
+
# Retrieves library document audit trail file
|
110
|
+
#
|
111
|
+
# @param agreement_id [String] (REQUIRED)
|
112
|
+
# @param file_path [String] File path where to save the CSV file. If no file path is given, nothing is saved to
|
113
|
+
# disk.
|
114
|
+
# @return [String] Raw bytes representing CSV file
|
115
|
+
def agreement_form_data(agreement_id, file_path = nil)
|
116
|
+
response = request(:agreement_form_data, agreement_id)
|
117
|
+
unless file_path.nil?
|
118
|
+
file = File.new(file_path, 'wb')
|
119
|
+
file.write(response)
|
120
|
+
file.close
|
121
|
+
end
|
122
|
+
response
|
123
|
+
end
|
117
124
|
end
|
118
125
|
end
|