From 8ae395e2c64d568ea2b23fa9e1b9beec2d78b85a Mon Sep 17 00:00:00 2001 From: Joel Barker Date: Thu, 18 Oct 2018 12:46:53 -0700 Subject: [PATCH] Regenerate docs with yard --- doc/Echosign.html | 4 +- doc/Echosign/Agreement.html | 50 +- doc/Echosign/Client.html | 505 ++++----- doc/Echosign/CounterSignerInfo.html | 2 +- doc/Echosign/Credentials.html | 891 +++++++++++++-- doc/Echosign/Fileinfo.html | 8 +- doc/Echosign/FormFieldLocation.html | 8 +- doc/Echosign/MegaSign.html | 40 +- doc/Echosign/ParameterError.html | 2 +- doc/Echosign/PhoneInfo.html | 8 +- doc/Echosign/Recipient.html | 14 +- doc/Echosign/RecipientSecurityOption.html | 12 +- doc/Echosign/Refresh.html | 22 +- doc/Echosign/Reminder.html | 2 +- doc/Echosign/Request.html | 1050 +++++++----------- doc/Echosign/Request/EndpointHash.html | 328 ++++++ doc/Echosign/Request/Failure.html | 2 +- doc/Echosign/RequestFormField.html | 8 +- doc/Echosign/RequiredParameterError.html | 2 +- doc/Echosign/UrlFileInfo.html | 12 +- doc/Echosign/User.html | 12 +- doc/Echosign/Validatable.html | 37 +- doc/Echosign/Widget.html | 295 ++++- doc/Echosign/WidgetCompletionInfo.html | 34 +- doc/Echosign/WidgetPersonalization.html | 18 +- doc/Echosign/WidgetSecurityOption.html | 10 +- doc/Echosign/WidgetSignerSecurityOption.html | 12 +- doc/Echosign/WidgetStatus.html | 12 +- doc/Echosign/WidgetVaultingInfo.html | 2 +- doc/_index.html | 9 +- doc/class_list.html | 2 +- doc/file.README.html | 48 +- doc/index.html | 48 +- doc/method_list.html | 202 ++-- doc/top-level-namespace.html | 2 +- 35 files changed, 2415 insertions(+), 1298 deletions(-) create mode 100644 doc/Echosign/Request/EndpointHash.html diff --git a/doc/Echosign.html b/doc/Echosign.html index 4af642f..e3065d8 100644 --- a/doc/Echosign.html +++ b/doc/Echosign.html @@ -109,7 +109,7 @@

VERSION =
-
"1.0.2"
+
"1.5.0"
@@ -125,7 +125,7 @@

diff --git a/doc/Echosign/Agreement.html b/doc/Echosign/Agreement.html index 5d126d3..4f1c56c 100644 --- a/doc/Echosign/Agreement.html +++ b/doc/Echosign/Agreement.html @@ -337,8 +337,10 @@

A list of one or more recipients. For regular (non-MegaSign) documents, there is no limit on the number of electronic signatures in a single document. Written signatures are limited to four per document. This limit -includes the sender if the sender's signature is also required. -Populate the array with instances of Echosign::Recipient (REQUIRED)

+includes the sender if the sender's signature is also required.

+ +
Populate the array with instances of {Echosign::Recipient Echosign::Recipient} (REQUIRED)
+
@@ -401,27 +403,27 @@

 
 
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
 36
-37
+37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 -
# File 'lib/echosign/agreement.rb', line 25
+      
# File 'lib/echosign/agreement.rb', line 36
 
-def initialize(user_id=nil, user_email=nil, params)
+def initialize(user_id = nil, user_email = nil, params)
   @user_id = user_id
   @user_email = user_email
-  #TODO (cthomas) barf if user_id or user_email are blank
+  # TODO (cthomas) barf if user_id or user_email are blank
   if params.has_key?(:recipients)
     warn("NOTE: :recipients param in #{self.class}.new is deprecated; use :recipientSetInfos instead.\n" +
          "#{self.class}.new called from #{Gem.location_of_caller.join(":")}")
@@ -469,12 +471,12 @@ 

 
 
+11
 12
-13
-14
+13

-
# File 'lib/echosign/agreement.rb', line 12
+      
# File 'lib/echosign/agreement.rb', line 11
 
 def user_email
   @user_email
@@ -512,12 +514,12 @@ 

 
 
+11
 12
-13
-14
+13

-
# File 'lib/echosign/agreement.rb', line 12
+      
# File 'lib/echosign/agreement.rb', line 11
 
 def user_id
   @user_id
@@ -533,7 +535,7 @@ 

diff --git a/doc/Echosign/Client.html b/doc/Echosign/Client.html index 2fc2daf..e04523e 100644 --- a/doc/Echosign/Client.html +++ b/doc/Echosign/Client.html @@ -507,7 +507,7 @@

Creates a widget and returns the Javascript snippet and URL to access the -widget and widgetID in response to the client.

+widget and widgetID in response to the client.

@@ -516,7 +516,7 @@

  • - #get_agreements ⇒ String + #get_agreements ⇒ Hash @@ -636,7 +636,7 @@

  • - #get_mega_signs ⇒ String + #get_mega_signs ⇒ Hash @@ -878,7 +878,7 @@

  • - #initialize(credentials) ⇒ Echosign::Client + #initialize(token) ⇒ Echochamber::Client @@ -1152,7 +1152,7 @@

    Constructor Details

    - #initialize(credentials) ⇒ Echosign::Client + #initialize(token) ⇒ Echochamber::Client @@ -1172,16 +1172,16 @@

  • - credentials + token - (Echosign::Credentials) + (String)
    -

    Initialized Echosign::Credentials

    +

    Access token or integration key

  • @@ -1195,15 +1195,17 @@

     
     
    +13
    +14
     15
    -16
    -17
    +16

  • -
    # File 'lib/echosign/client.rb', line 15
    +      
    # File 'lib/echosign/client.rb', line 13
     
    -def initialize(credentials)
    -  @token = Echosign::Request.get_token_from_refresh(credentials)
    +def initialize(token)
    +  @token = token
    +  @base_uri = nil
     end
    @@ -1243,12 +1245,12 @@

     
     
    -10
    -11
    -12
    +7 +8 +9

    -
    # File 'lib/echosign/client.rb', line 10
    +      
    # File 'lib/echosign/client.rb', line 7
     
     def token
       @token
    @@ -1425,21 +1427,25 @@ 

     
     
    -92
    -93
    -94
    -95
    -96
     97
     98
     99
    -100
    +100 +101 +102 +103 +104 +105 +106 +107

    -
    # File 'lib/echosign/agreement/client.rb', line 92
    +      
    # File 'lib/echosign/agreement/client.rb', line 97
     
    -def agreement_combined_pdf(agreement_id, file_path=nil, versionId=nil, participantEmail=nil, attachSupportingDocuments=true, auditReport=false)
    -  response = Echosign::Request.agreement_combined_pdf(token, agreement_id, versionId, participantEmail, attachSupportingDocuments, auditReport)
    +def agreement_combined_pdf(agreement_id, file_path = nil, versionId = nil, participantEmail = nil,
    +                           attachSupportingDocuments = true, auditReport = false)
    +  response = request(:agreement_combined_pdf, agreement_id, versionId, participantEmail, attachSupportingDocuments,
    +                     auditReport)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -1551,7 +1557,6 @@ 

     
     
    -65
     66
     67
     68
    @@ -1559,13 +1564,14 @@ 

    70 71 72 -73

    +73 +74

    -
    # File 'lib/echosign/agreement/client.rb', line 65
    +      
    # File 'lib/echosign/agreement/client.rb', line 66
     
    -def agreement_document_file(agreement_id, document_id, file_path=nil)
    -  response = Echosign::Request.agreement_document_file(token, agreement_id, document_id)
    +def agreement_document_file(agreement_id, document_id, file_path = nil)
    +  response = request(:agreement_document_file, agreement_id, document_id)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -1695,15 +1701,15 @@ 

     
     
    -55
     56
    -57
    +57 +58

    -
    # File 'lib/echosign/agreement/client.rb', line 55
    +      
    # File 'lib/echosign/agreement/client.rb', line 56
     
    -def agreement_documents(agreement_id, recipient_email, format, version_id=nil)
    -  result = Echosign::Request.agreement_documents(token, agreement_id, recipient_email, format, version_id)
    +def agreement_documents(agreement_id, recipient_email, format, version_id = nil)
    +  result = request(:agreement_documents, agreement_id, recipient_email, format, version_id)
     end
    @@ -1793,21 +1799,21 @@

     
     
    -107
    -108
    -109
    -110
    -111
    -112
    -113
    -114
    -115
    +115 +116 +117 +118 +119 +120 +121 +122 +123

    -
    # File 'lib/echosign/agreement/client.rb', line 107
    +      
    # File 'lib/echosign/agreement/client.rb', line 115
     
    -def agreement_form_data(agreement_id, file_path=nil)
    -  response = Echosign::Request.agreement_form_data(token, agreement_id)
    +def agreement_form_data(agreement_id, file_path = nil)
    +  response = request(:agreement_form_data, agreement_id)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -1884,15 +1890,15 @@ 

     
     
    +26
     27
    -28
    -29
    +28

    -
    # File 'lib/echosign/agreement/client.rb', line 27
    +      
    # File 'lib/echosign/agreement/client.rb', line 26
     
     def agreement_info(agreement_id)
    -  Echosign::Request.agreement_info(token, agreement_id)
    +  request(:agreement_info, agreement_id)
     end
    @@ -1964,15 +1970,15 @@

     
     
    -79
     80
    -81
    +81 +82

    -
    # File 'lib/echosign/agreement/client.rb', line 79
    +      
    # File 'lib/echosign/agreement/client.rb', line 80
     
     def agreement_signing_urls(agreement_id)
    -  response = Echosign::Request.agreement_signing_urls(token, agreement_id)
    +  response = request(:agreement_signing_urls, agreement_id)
     end
    @@ -2062,6 +2068,7 @@

     
     
    +51
     52
     53
     54
    @@ -2069,14 +2076,13 @@ 

    56 57 58 -59 -60

    +59

    -
    # File 'lib/echosign/client.rb', line 52
    +      
    # File 'lib/echosign/client.rb', line 51
     
    -def audit_trail_pdf(agreement_id, file_path=nil)
    -  response = Echosign::Request.audit_trail_pdf(token, agreement_id)
    +def audit_trail_pdf(agreement_id, file_path = nil)
    +  response = request(:audit_trail_pdf, agreement_id)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -2190,6 +2196,7 @@ 

     
     
    +36
     37
     38
     39
    @@ -2198,20 +2205,19 @@ 

    42 43 44 -45 -46

    +45

    -
    # File 'lib/echosign/agreement/client.rb', line 37
    +      
    # File 'lib/echosign/agreement/client.rb', line 36
     
    -def cancel_agreement(agreement_id, notify_signer=false, comment=nil)
    +def cancel_agreement(agreement_id, notify_signer = false, comment = nil)
       request_body = {
         "value" => "CANCEL",
    -    "notifySigner" => notify_signer 
    +    "notifySigner" => notify_signer
       }
    -  request_body.merge!(comment: comment) unless comment.nil?
    +  request_body[:comment] = comment unless comment.nil?
     
    -  agreement_status_response = Echosign::Request.update_agreement_status(token, agreement_id, request_body)
    +  agreement_status_response = request(:update_agreement_status, agreement_id, request_body)
       agreement_status_response.fetch('result')
     end
    @@ -2320,28 +2326,28 @@

     
     
    +35
    +36
    +37
     38
     39
     40
     41
     42
     43
    -44
    -45
    -46
    -47
    +44

    -
    # File 'lib/echosign/mega_sign/client.rb', line 38
    +      
    # File 'lib/echosign/mega_sign/client.rb', line 35
     
    -def cancel_mega_sign(mega_sign_id, notify_signer=false, comment=nil)
    +def cancel_mega_sign(mega_sign_id, notify_signer = false, comment = nil)
       request_body = {
         "value" => "CANCEL",
    -    "notifySigner" => notify_signer 
    +    "notifySigner" => notify_signer
       }
    -  request_body.merge!(comment: comment) unless comment.nil?
    +  request_body[:comment] = comment unless comment.nil?
     
    -  mega_sign_status_response = Echosign::Request.update_mega_sign_status(token, mega_sign_id, request_body)
    +  mega_sign_status_response = request(:update_mega_sign_status, mega_sign_id, request_body)
       mega_sign_status_response.fetch('result')
     end
    @@ -2408,17 +2414,21 @@

     
     
    +7
    +8
     9
     10
     11
     12
    -
    # File 'lib/echosign/agreement/client.rb', line 9
    +      
    # File 'lib/echosign/agreement/client.rb', line 7
     
     def create_agreement(agreement)
    -   agreement_response = Echosign::Request.create_agreement(agreement, token, agreement.user_id, agreement.user_email)
    -   agreement_response.fetch("agreementId")
    +  agreement_response = request(:create_agreement, agreement, agreement.user_id, agreement.user_email)
    +  return agreement_response['agreementId'] if agreement_response.has_key?('agreementId')
    +
    +  raise "Error creating agreement - response was #{agreement_response}"
     end
    @@ -2484,19 +2494,19 @@

     
     
    +7
    +8
     9
     10
    -11
    -12
    -13
    +11

    -
    # File 'lib/echosign/mega_sign/client.rb', line 9
    +      
    # File 'lib/echosign/mega_sign/client.rb', line 7
     
     def create_mega_sign(mega_sign)
    -   mega_sign_response = Echosign::Request.create_mega_sign(mega_sign, token, mega_sign.user_id, mega_sign.user_email)
    -   puts mega_sign_response.inspect
    -   mega_sign_response.fetch("mega_signId")
    +  mega_sign_response = request(:create_mega_sign, mega_sign, mega_sign.user_id, mega_sign.user_email)
    +  puts mega_sign_response.inspect
    +  mega_sign_response.fetch("mega_signId")
     end
    @@ -2562,15 +2572,15 @@

     
     
    +31
     32
    -33
    -34
    +33

    -
    # File 'lib/echosign/client.rb', line 32
    +      
    # File 'lib/echosign/client.rb', line 31
     
     def create_reminder(reminder)
    -  reminder_response = Echosign::Request.create_reminder(token, reminder)
    +  reminder_response = request(:create_reminder, reminder)
     end
    @@ -2658,16 +2668,16 @@

     
     
    +41
     42
     43
    -44
    -45
    +44

    -
    # File 'lib/echosign/client.rb', line 42
    +      
    # File 'lib/echosign/client.rb', line 41
     
     def create_transient_document(file_name, mime_type, file_handle)
    -  transient_document_response = Echosign::Request.create_transient_document(token, file_name, file_handle, mime_type)
    +  transient_document_response = request(:create_transient_document, file_name, file_handle, mime_type)
       transient_document_response.fetch("transientDocumentId")
     end
    @@ -2734,16 +2744,16 @@

     
     
    +22
     23
     24
    -25
    -26
    +25

    -
    # File 'lib/echosign/client.rb', line 23
    +      
    # File 'lib/echosign/client.rb', line 22
     
     def create_user(user)
    -  user_response  = Echosign::Request.create_user(user, token)
    +  user_response = request(:create_user, user)
       user_response.fetch("userId")
     end
    @@ -2764,7 +2774,10 @@

    Creates a widget and returns the Javascript snippet and URL to access the -widget and widgetID in response to the client

    +widget and widgetID in response to

    + +
    the client
    +
    @@ -2806,15 +2819,15 @@

     
     
    +8
     9
    -10
    -11
    +10

    -
    # File 'lib/echosign/widget/client.rb', line 9
    +      
    # File 'lib/echosign/widget/client.rb', line 8
     
     def create_widget(widget)
    -  Echosign::Request.create_widget(token, widget)
    +  request(:create_widget, widget)
     end
    @@ -2824,7 +2837,7 @@

    - #get_agreementsString + #get_agreementsHash @@ -2839,35 +2852,20 @@

    -

    Parameters:

    - -

    Returns:

    • - (String) + (Hash)
      -

      Agreement ID

      +

      An array of user agreement items

    • @@ -2880,16 +2878,16 @@

       
       
      +17
       18
       19
      -20
      -21
      +20

    -
    # File 'lib/echosign/agreement/client.rb', line 18
    +      
    # File 'lib/echosign/agreement/client.rb', line 17
     
     def get_agreements
    -  get_agreements_response = Echosign::Request.get_agreements(token)
    +  get_agreements_response = request(:get_agreements)
       get_agreements_response.fetch("userAgreementList")
     end
    @@ -2969,7 +2967,7 @@

    # File 'lib/echosign/library_documents/client.rb', line 18
     
     def get_library_document(library_document_id)
    -  Echosign::Request.get_library_document(token, library_document_id)
    +  request(:get_library_document, library_document_id)
     end
    @@ -3083,8 +3081,8 @@

    # File 'lib/echosign/library_documents/client.rb', line 36
     
    -def get_library_document_file(library_document_id, file_id, file_path=nil)
    -  response = Echosign::Request.get_library_document_file(token, library_document_id, file_id)
    +def get_library_document_file(library_document_id, file_id, file_path = nil)
    +  response = request(:get_library_document_file, library_document_id, file_id)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -3169,7 +3167,7 @@ 

    # File 'lib/echosign/library_documents/client.rb', line 26
     
     def get_library_document_files(library_document_id)
    -  Echosign::Request.get_library_document_files(token, library_document_id)
    +  request(:get_library_document_files, library_document_id)
     end
    @@ -3270,8 +3268,8 @@

    # File 'lib/echosign/library_documents/client.rb', line 10
     
    -def get_library_documents(user_id=nil, user_email=nil)
    -  Echosign::Request.get_library_documents(token, user_id, user_email)
    +def get_library_documents(user_id = nil, user_email = nil)
    +  request(:get_library_documents, user_id, user_email)
     end
    @@ -3281,7 +3279,7 @@

    - #get_mega_signsString + #get_mega_signsHash @@ -3296,35 +3294,20 @@

    -

    Parameters:

    - -

    Returns:

    • - (String) + (Hash)
      -

      Agreement ID

      +

      An array of mega sign parent agreements

    • @@ -3337,17 +3320,17 @@

       
       
      -19
      -20
      -21
      -22
      +16 +17 +18 +19

    -
    # File 'lib/echosign/mega_sign/client.rb', line 19
    +      
    # File 'lib/echosign/mega_sign/client.rb', line 16
     
     def get_mega_signs
    -  get_mega_signs_response = Echosign::Request.get_mega_signs(token)
    -  get_mega_signs_response.fetch("userAgreementList")
    +  get_mega_signs_response = request(:get_mega_signs)
    +  get_mega_signs_response.fetch("megaSignList")
     end
    @@ -3413,15 +3396,15 @@

     
     
    -75
    -76
    -77
    +73 +74 +75

    -
    # File 'lib/echosign/client.rb', line 75
    +      
    # File 'lib/echosign/client.rb', line 73
     
     def get_user(user_id)
    -  Echosign::Request.get_user(token, user_id)
    +  request(:get_user, user_id)
     end
    @@ -3492,15 +3475,15 @@

     
     
    -67
    -68
    -69
    +65 +66 +67

    -
    # File 'lib/echosign/client.rb', line 67
    +      
    # File 'lib/echosign/client.rb', line 65
     
     def get_users(user_email)
    -  Echosign::Request.get_users(token, user_email)
    +  request(:get_users, user_email)
     end
    @@ -3566,15 +3549,15 @@

     
     
    -44
     45
    -46
    +46 +47

    -
    # File 'lib/echosign/widget/client.rb', line 44
    +      
    # File 'lib/echosign/widget/client.rb', line 45
     
     def get_widget(widget_id)
    -  Echosign::Request.get_widget(token, widget_id)
    +  request(:get_widget, widget_id)
     end
    @@ -3667,21 +3650,21 @@

     
     
    -80
    -81
     82
     83
     84
     85
     86
     87
    -88
    +88 +89 +90

    -
    # File 'lib/echosign/widget/client.rb', line 80
    +      
    # File 'lib/echosign/widget/client.rb', line 82
     
    -def get_widget_audit_trail(widget_id, file_path=nil)
    -  response = Echosign::Request.get_widget_audit_trail(token, widget_id)
    +def get_widget_audit_trail(widget_id, file_path = nil)
    +  response = request(:get_widget_audit_trail, widget_id)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -3781,21 +3764,21 @@ 

     
     
    -96
    -97
     98
     99
     100
     101
     102
     103
    -104
    +104 +105 +106

    -
    # File 'lib/echosign/widget/client.rb', line 96
    +      
    # File 'lib/echosign/widget/client.rb', line 98
     
    -def get_widget_combined_pdf(widget_id, file_path=nil)
    -  response = Echosign::Request.get_widget_combined_pdf(token, widget_id)
    +def get_widget_combined_pdf(widget_id, file_path = nil)
    +  response = request(:get_widget_combined_pdf, widget_id)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -3897,21 +3880,21 @@ 

     
     
    -64
    -65
     66
     67
     68
     69
     70
     71
    -72
    +72 +73 +74

    -
    # File 'lib/echosign/widget/client.rb', line 64
    +      
    # File 'lib/echosign/widget/client.rb', line 66
     
    -def get_widget_document_file(widget_id, document_id, file_path=nil)
    -  response = Echosign::Request.get_widget_document_file(token, widget_id, document_id)
    +def get_widget_document_file(widget_id, document_id, file_path = nil)
    +  response = request(:get_widget_document_file, widget_id, document_id)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -4020,15 +4003,15 @@ 

     
     
    -54
    -55
    -56
    +56 +57 +58

    -
    # File 'lib/echosign/widget/client.rb', line 54
    +      
    # File 'lib/echosign/widget/client.rb', line 56
     
    -def get_widget_documents(widget_id, version_id=nil, participant_email=nil)
    -  Echosign::Request.get_widget_documents(token, widget_id, version_id, participant_email)
    +def get_widget_documents(widget_id, version_id = nil, participant_email = nil)
    +  request(:get_widget_documents, widget_id, version_id, participant_email)
     end
    @@ -4122,21 +4105,21 @@

     
     
    -112
    -113
     114
     115
     116
     117
     118
     119
    -120
    +120 +121 +122

    -
    # File 'lib/echosign/widget/client.rb', line 112
    +      
    # File 'lib/echosign/widget/client.rb', line 114
     
    -def get_widget_form_data(widget_id, file_path=nil)
    -  response = Echosign::Request.get_widget_form_data(token, widget_id)
    +def get_widget_form_data(widget_id, file_path = nil)
    +  response = request(:get_widget_form_data, widget_id)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -4202,7 +4185,7 @@ 

    The email address of the user whose widgets are being requested. If both -user_id and user_email are provided then user_id is given preference. If +user_id and user_email are provided then user_id is given preference. If neither is specified then the user is inferred from the access token

    @@ -4235,15 +4218,15 @@

     
     
    -36
     37
    -38
    +38 +39

    -
    # File 'lib/echosign/widget/client.rb', line 36
    +      
    # File 'lib/echosign/widget/client.rb', line 37
     
    -def get_widgets(user_id=nil, user_email=nil)
    -  Echosign::Request.get_widgets(token, user_id, user_email)
    +def get_widgets(user_id = nil, user_email = nil)
    +  request(:get_widgets, user_id, user_email)
     end
    @@ -4347,7 +4330,6 @@

     
     
    -67
     68
     69
     70
    @@ -4355,13 +4337,14 @@ 

    72 73 74 -75

    +75 +76

    -
    # File 'lib/echosign/library_documents/client.rb', line 67
    +      
    # File 'lib/echosign/library_documents/client.rb', line 68
     
    -def library_combined_document(library_document_id, file_path=nil, auditReport=false)
    -  response = Echosign::Request.library_combined_document(token, library_document_id, auditReport)
    +def library_combined_document(library_document_id, file_path = nil, auditReport = false)
    +  response = request(:library_combined_document, library_document_id, auditReport)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -4465,8 +4448,8 @@ 

    # File 'lib/echosign/library_documents/client.rb', line 51
     
    -def library_document_audit_trail(library_document_id, file_path=nil)
    -  response = Echosign::Request.library_document_audit_trail(token, library_document_id)
    +def library_document_audit_trail(library_document_id, file_path = nil)
    +  response = request(:library_document_audit_trail, library_document_id)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -4639,21 +4622,25 @@ 

     
     
    -93
    -94
    -95
     96
     97
     98
     99
     100
    -101
    +101 +102 +103 +104 +105 +106

    -
    # File 'lib/echosign/mega_sign/client.rb', line 93
    +      
    # File 'lib/echosign/mega_sign/client.rb', line 96
     
    -def mega_sign_combined_pdf(mega_sign_id, file_path=nil, versionId=nil, participantEmail=nil, attachSupportingDocuments=true, auditReport=false)
    -  response = Echosign::Request.mega_sign_combined_pdf(token, mega_sign_id, versionId, participantEmail, attachSupportingDocuments, auditReport)
    +def mega_sign_combined_pdf(mega_sign_id, file_path = nil, versionId = nil, participantEmail = nil,
    +                           attachSupportingDocuments = true, auditReport = false)
    +  response = request(:mega_sign_combined_pdf, mega_sign_id, versionId, participantEmail, attachSupportingDocuments,
    +                     auditReport)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -4765,6 +4752,7 @@ 

     
     
    +65
     66
     67
     68
    @@ -4772,14 +4760,13 @@ 

    70 71 72 -73 -74

    +73

    -
    # File 'lib/echosign/mega_sign/client.rb', line 66
    +      
    # File 'lib/echosign/mega_sign/client.rb', line 65
     
    -def mega_sign_document_file(mega_sign_id, document_id, file_path=nil)
    -  response = Echosign::Request.mega_sign_document_file(token, mega_sign_id, document_id)
    +def mega_sign_document_file(mega_sign_id, document_id, file_path = nil)
    +  response = request(:mega_sign_document_file, mega_sign_id, document_id)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -4909,15 +4896,15 @@ 

     
     
    +55
     56
    -57
    -58
    +57

    -
    # File 'lib/echosign/mega_sign/client.rb', line 56
    +      
    # File 'lib/echosign/mega_sign/client.rb', line 55
     
    -def mega_sign_documents(mega_sign_id, recipient_email, format, version_id=nil)
    -  result = Echosign::Request.mega_sign_documents(token, mega_sign_id, recipient_email, format, version_id)
    +def mega_sign_documents(mega_sign_id, recipient_email, format, version_id = nil)
    +  result = request(:mega_sign_documents, mega_sign_id, recipient_email, format, version_id)
     end
    @@ -5007,21 +4994,21 @@

     
     
    -108
    -109
    -110
    -111
    -112
    -113
     114
     115
    -116
    +116 +117 +118 +119 +120 +121 +122

    -
    # File 'lib/echosign/mega_sign/client.rb', line 108
    +      
    # File 'lib/echosign/mega_sign/client.rb', line 114
     
    -def mega_sign_form_data(mega_sign_id, file_path=nil)
    -  response = Echosign::Request.mega_sign_form_data(token, mega_sign_id)
    +def mega_sign_form_data(mega_sign_id, file_path = nil)
    +  response = request(:mega_sign_form_data, mega_sign_id)
       unless file_path.nil?
         file = File.new(file_path, 'wb')
         file.write(response)
    @@ -5098,15 +5085,15 @@ 

     
     
    -28
    -29
    -30
    +25 +26 +27

    -
    # File 'lib/echosign/mega_sign/client.rb', line 28
    +      
    # File 'lib/echosign/mega_sign/client.rb', line 25
     
     def mega_sign_info(mega_sign_id)
    -  Echosign::Request.mega_sign_info(token, mega_sign_id)
    +  request(:mega_sign_info, mega_sign_id)
     end
    @@ -5178,15 +5165,15 @@

     
     
    +79
     80
    -81
    -82
    +81

    -
    # File 'lib/echosign/mega_sign/client.rb', line 80
    +      
    # File 'lib/echosign/mega_sign/client.rb', line 79
     
     def mega_sign_signing_urls(mega_sign_id)
    -  response = Echosign::Request.mega_sign_signing_urls(token, mega_sign_id)
    +  response = request(:mega_sign_signing_urls, mega_sign_id)
     end
    @@ -5263,15 +5250,15 @@

     
     
    +17
     18
    -19
    -20
    +19

    -
    # File 'lib/echosign/widget/client.rb', line 18
    +      
    # File 'lib/echosign/widget/client.rb', line 17
     
     def personalize_widget(widget_id, personalization)
    -  Echosign::Request.personalize_widget(token, widget_id, personalization)
    +  request(:personalize_widget, widget_id, personalization)
     end
    @@ -5348,15 +5335,15 @@

     
     
    +26
     27
    -28
    -29
    +28

    -
    # File 'lib/echosign/widget/client.rb', line 27
    +      
    # File 'lib/echosign/widget/client.rb', line 26
     
     def update_widget_status(widget_id, status)
    -  Echosign::Request.update_widget_status(token, widget_id, status)
    +  request(:update_widget_status, widget_id, status)
     end
    @@ -5368,7 +5355,7 @@

    diff --git a/doc/Echosign/CounterSignerInfo.html b/doc/Echosign/CounterSignerInfo.html index bb12d57..b250899 100644 --- a/doc/Echosign/CounterSignerInfo.html +++ b/doc/Echosign/CounterSignerInfo.html @@ -257,7 +257,7 @@

    diff --git a/doc/Echosign/Credentials.html b/doc/Echosign/Credentials.html index e5b8267..73adb45 100644 --- a/doc/Echosign/Credentials.html +++ b/doc/Echosign/Credentials.html @@ -69,13 +69,11 @@
    Inherits:
    - Hash + Object
    • Object
    • - -
    @@ -107,8 +105,136 @@ + +

    + Constant Summary + collapse +

    + +
    + +
    OAUTH_SITE = + +
    +
    'https://secure.echosign.com'
    + +
    AUTHORIZE_PATH = + +
    +
    '/public/oauth'
    + +
    TOKEN_PATH = + +
    +
    '/oauth/token'
    + +
    REFRESH_PATH = + +
    +
    '/oauth/refresh'
    + +
    REVOKE_PATH = + +
    +
    '/oauth/revoke'
    + +
    + + + + + +

    Instance Attribute Summary collapse

    +
      + +
    • + + + #access_token ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
      +

      Returns the value of attribute access_token.

      +
      + +
    • + + +
    • + + + #expires_at ⇒ Object + + + + + + + + + readonly + + + + + + + + + +
      +

      Returns the value of attribute expires_at.

      +
      + +
    • + + +
    • + + + #refresh_token ⇒ Object + + + + + + + + + readonly + + + + + + + + +
      +

      Returns the value of attribute refresh_token.

      +
      + +
    • + +
    @@ -124,7 +250,55 @@

  • - #initialize(app_id, app_secret, api_key, email, password) ⇒ Echosign::Credentials + #authorize_url(redirect_uri, scope, state = nil) ⇒ Echosign::Credentials + + + + + + + + + + + + + +
    +

    Build an authorization endpoint URL for EchoSign's OAuth2 provider.

    +
    + +
  • + + +
  • + + + #get_token(code, redirect_uri) ⇒ String + + + + + + + + + + + + + +
    +

    Make a request to the token endpoint and return an access token.

    +
    + +
  • + + +
  • + + + #initialize(client_id, client_secret) ⇒ Echosign::Credentials @@ -141,7 +315,55 @@

    -

    Builds a Credentials object.

    +

    Builds an Credentials object.

    +
    + +

  • + + +
  • + + + #refresh_access_token(current_refresh_token = nil) ⇒ String + + + + + + + + + + + + + +
    +

    Update (refresh) an access token.

    +
    + +
  • + + +
  • + + + #revoke_token(which = :access) ⇒ void + + + + + + + + + + + + + +
    +

    Revoke an access or refresh token, and any corresponding tokens.

  • @@ -161,14 +383,13 @@

    Methods included from Validatable

    #require_exactly_one, #require_keys, #validate_field

    - -
    +

    Constructor Details

    - #initialize(app_id, app_secret, api_key, email, password) ⇒ Echosign::Credentials + #initialize(client_id, client_secret) ⇒ Echosign::Credentials @@ -177,7 +398,7 @@

    -

    Builds a Credentials object

    +

    Builds an Credentials object

    @@ -188,55 +409,7 @@

  • - app_id - - - (String) - - - - — -
    -

    Application key

    -
    - -
  • - -
  • - - app_secret - - - (String) - - - - — -
    -

    Application secret

    -
    - -
  • - -
  • - - api_key - - - (String) - - - - — -
    -

    API Key

    -
    - -
  • - -
  • - - email + client_id (String) @@ -245,14 +418,14 @@

    -

    User email

    +

    Client ID

  • - password + client_secret (String) @@ -261,7 +434,7 @@

    -

    User password

    +

    Client secret

  • @@ -275,13 +448,6 @@

     
     
    -14
    -15
    -16
    -17
    -18
    -19
    -20
     21
     22
     23
    @@ -293,22 +459,15 @@ 

    29

    -
    # File 'lib/echosign/credentials.rb', line 14
    -
    -def initialize(app_id, app_secret, api_key, email, password)
    -
    -  merge!(
    -    {
    -      applicationCredentials:  {
    -      applicationId: app_id,
    -      applicationSecret: app_secret
    -    },
    -      userCredentials: {
    -        apiKey: api_key,
    -        email: email,
    -        password: password 
    -      }
    -    }
    +      
    # File 'lib/echosign/credentials.rb', line 21
    +
    +def initialize(client_id, client_secret)
    +  @client = OAuth2::Client.new(
    +    client_id,
    +    client_secret,
    +    site: OAUTH_SITE,
    +    authorize_url: AUTHORIZE_PATH,
    +    token_url: TOKEN_PATH
       )
     end
    @@ -318,11 +477,573 @@

    +
    +

    Instance Attribute Details

    + + + +
    +

    + + #access_tokenObject (readonly) + + + + + +

    +
    + +

    Returns the value of attribute access_token

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +13
    +14
    +15
    +
    +
    # File 'lib/echosign/credentials.rb', line 13
    +
    +def access_token
    +  @access_token
    +end
    +
    +
    + + + +
    +

    + + #expires_atObject (readonly) + + + + + +

    +
    + +

    Returns the value of attribute expires_at

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +13
    +14
    +15
    +
    +
    # File 'lib/echosign/credentials.rb', line 13
    +
    +def expires_at
    +  @expires_at
    +end
    +
    +
    + + + +
    +

    + + #refresh_tokenObject (readonly) + + + + + +

    +
    + +

    Returns the value of attribute refresh_token

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +13
    +14
    +15
    +
    +
    # File 'lib/echosign/credentials.rb', line 13
    +
    +def refresh_token
    +  @refresh_token
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #authorize_url(redirect_uri, scope, state = nil) ⇒ Echosign::Credentials + + + + + +

    +
    + +

    Build an authorization endpoint URL for EchoSign's OAuth2 provider

    + +

    The redirect_uri must be specified on the app's OAuth Configuration +page.

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + redirect_uri + + + (String) + + + + — +
      +

      A secure URL to redirect the user afterward

      +
      + +
    • + +
    • + + scope + + + (String) + + + + — +
      +

      Space delimited set of permissions to approve

      +
      + +
    • + +
    • + + state + + + (String) + + + (defaults to: nil) + + + — +
      +

      Any value; will be returned to the client afterward

      +
      + +
    • + +
    + +

    Returns:

    + + +

    See Also:

    + + +
    + + + + +
    +
    +
    +
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +
    +
    # File 'lib/echosign/credentials.rb', line 41
    +
    +def authorize_url(redirect_uri, scope, state = nil)
    +  return @client.auth_code.authorize_url(
    +    redirect_uri: redirect_uri,
    +    scope: scope,
    +    state: state
    +  )
    +end
    +
    +
    + +
    +

    + + #get_token(code, redirect_uri) ⇒ String + + + + + +

    +
    + +

    Make a request to the token endpoint and return an access token

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + code + + + (String) + + + + — +
      +

      The authorization code obtained after #authorize_url

      +
      + +
    • + +
    • + + redirect_uri + + + (String) + + + + — +
      +

      The redirect_url used during #authorize_url

      +
      + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (String) + + + + — +
      +

      An access token that can be used in the EchoSign API

      +
      + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +
    +
    # File 'lib/echosign/credentials.rb', line 55
    +
    +def get_token(code, redirect_uri)
    +  @client.options[:token_url] = TOKEN_PATH
    +  oauth_token = @client.get_token(code: code,
    +                                  redirect_uri: redirect_uri,
    +                                  grant_type: :authorization_code)
    +
    +  @access_token = oauth_token.token
    +  @refresh_token = oauth_token.refresh_token
    +  @expires_at = oauth_token.expires_at
    +
    +  return @access_token
    +end
    +
    +
    + +
    +

    + + #refresh_access_token(current_refresh_token = nil) ⇒ String + + + + + +

    +
    + +

    Update (refresh) an access token

    + +

    This method should only be called after #get_token

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + current_refresh_token + + + (String) + + + (defaults to: nil) + + + — +
      +

      A previously obtained refresh_token from a get_token request

      +
      + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (String) + + + + — +
      +

      A new access token to be used in the EchoSign API

      +
      + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +
    +
    # File 'lib/echosign/credentials.rb', line 75
    +
    +def refresh_access_token(current_refresh_token = nil)
    +  @refresh_token = current_refresh_token if current_refresh_token != nil
    +
    +  @client.options[:token_url] = REFRESH_PATH
    +  oauth_token = @client.get_token(grant_type: :refresh_token, refresh_token: @refresh_token)
    +
    +  @access_token = oauth_token.token
    +  @expires_at = oauth_token.expires_at
    +
    +  return @access_token
    +end
    +
    +
    + +
    +

    + + #revoke_token(which = :access) ⇒ void + + + + + +

    +
    +

    This method returns an undefined value.

    +

    Revoke an access or refresh token, and any corresponding tokens

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + which + + + (Symbol) + + + (defaults to: :access) + + + — +
      +

      The token to revoke, either :access or :refresh

      +
      + +
    • + +
    + + +
    + + + + +
    +
    +
    +
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +
    +
    # File 'lib/echosign/credentials.rb', line 92
    +
    +def revoke_token(which = :access)
    +  if which == :access
    +    @client.request(:post, REVOKE_PATH, body: { token: @access_token })
    +  else
    +    @client.request(:post, REVOKE_PATH, body: { token: @refresh_token })
    +    @refresh_token = nil
    +  end
    +
    +  @access_token = nil
    +  @expires_at = nil
    +end
    +
    +
    + +
    diff --git a/doc/Echosign/Fileinfo.html b/doc/Echosign/Fileinfo.html index bcb93f2..f14c95e 100644 --- a/doc/Echosign/Fileinfo.html +++ b/doc/Echosign/Fileinfo.html @@ -272,13 +272,13 @@

     
     
    +13
     14
     15
    -16
    -17
    +16

    -
    # File 'lib/echosign/agreement/fileinfo.rb', line 14
    +      
    # File 'lib/echosign/agreement/fileinfo.rb', line 13
     
     def initialize(params)
       require_exactly_one([:transientDocumentId, :libraryDocumentId, :libraryDocumentName, :documentURL], params)
    @@ -295,7 +295,7 @@ 

    diff --git a/doc/Echosign/FormFieldLocation.html b/doc/Echosign/FormFieldLocation.html index 2a51ef4..169cb44 100644 --- a/doc/Echosign/FormFieldLocation.html +++ b/doc/Echosign/FormFieldLocation.html @@ -231,13 +231,13 @@

     
     
    +14
     15
     16
    -17
    -18
    +17

    -
    # File 'lib/echosign/agreement/form_field_location.rb', line 15
    +      
    # File 'lib/echosign/agreement/form_field_location.rb', line 14
     
     def initialize(params)
       require_keys([:pageNumber, :left, :top, :width, :height], params)
    @@ -254,7 +254,7 @@ 

    diff --git a/doc/Echosign/MegaSign.html b/doc/Echosign/MegaSign.html index f800cb0..ebcff30 100644 --- a/doc/Echosign/MegaSign.html +++ b/doc/Echosign/MegaSign.html @@ -337,8 +337,10 @@

    A list of one or more recipients. For regular (non-MegaSign) documents, there is no limit on the number of electronic signatures in a single document. Written signatures are limited to four per document. This limit -includes the sender if the sender's signature is also required. -Populate the array with instances of Echosign::Recipient (REQUIRED)

    +includes the sender if the sender's signature is also required.

    + +
    Populate the array with instances of {Echosign::Recipient Echosign::Recipient} (REQUIRED)
    +
    @@ -401,21 +403,21 @@

     
     
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    +34 +35 +36 +37 +38 +39 +40

    -
    # File 'lib/echosign/mega_sign.rb', line 23
    +      
    # File 'lib/echosign/mega_sign.rb', line 34
     
    -def initialize(user_id=nil, user_email=nil, params)
    +def initialize(user_id = nil, user_email = nil, params)
       @user_id = user_id
       @user_email = user_email
    -  #TODO (cthomas) barf if user_id or user_email are blank
    +  # TODO (cthomas) barf if user_id or user_email are blank
       require_keys([:signatureType, :recipientSetInfos, :signatureFlow, :fileInfos, :name], params)
       merge!({ megaSignCreationInfo: params })
     end
    @@ -457,12 +459,12 @@

     
     
    +9
     10
    -11
    -12
    +11

    -
    # File 'lib/echosign/mega_sign.rb', line 10
    +      
    # File 'lib/echosign/mega_sign.rb', line 9
     
     def user_email
       @user_email
    @@ -500,12 +502,12 @@ 

     
     
    +9
     10
    -11
    -12
    +11

    -
    # File 'lib/echosign/mega_sign.rb', line 10
    +      
    # File 'lib/echosign/mega_sign.rb', line 9
     
     def user_id
       @user_id
    @@ -521,7 +523,7 @@ 

    diff --git a/doc/Echosign/ParameterError.html b/doc/Echosign/ParameterError.html index 8099037..63c08e0 100644 --- a/doc/Echosign/ParameterError.html +++ b/doc/Echosign/ParameterError.html @@ -114,7 +114,7 @@ diff --git a/doc/Echosign/PhoneInfo.html b/doc/Echosign/PhoneInfo.html index 95ec540..1cae2b7 100644 --- a/doc/Echosign/PhoneInfo.html +++ b/doc/Echosign/PhoneInfo.html @@ -248,13 +248,13 @@

     
     
    -13
     14
     15
    -16
    +16 +17

    -
    # File 'lib/echosign/agreement/phone_info.rb', line 13
    +      
    # File 'lib/echosign/agreement/phone_info.rb', line 14
     
     def initialize(params)
       require_keys([:phone], params)
    @@ -271,7 +271,7 @@ 

    diff --git a/doc/Echosign/Recipient.html b/doc/Echosign/Recipient.html index 24c311b..05e6d13 100644 --- a/doc/Echosign/Recipient.html +++ b/doc/Echosign/Recipient.html @@ -276,17 +276,19 @@

     
     
    -15
    -16
     17
    -18
    +18 +19 +20 +21

    -
    # File 'lib/echosign/agreement/recipient.rb', line 15
    +      
    # File 'lib/echosign/agreement/recipient.rb', line 17
     
     def initialize(params)
       require_exactly_one([:email, :fax], params)
    -  merge!(params)
    +  email_or_fax = params[:email] ? { email: params[:email] } : { fax: params[:fax] }
    +  merge!(recipientSetMemberInfos: email_or_fax, recipientSetRole: params[:role])
     end
    @@ -299,7 +301,7 @@

    diff --git a/doc/Echosign/RecipientSecurityOption.html b/doc/Echosign/RecipientSecurityOption.html index 8180418..dc205d8 100644 --- a/doc/Echosign/RecipientSecurityOption.html +++ b/doc/Echosign/RecipientSecurityOption.html @@ -234,7 +234,7 @@

    -

    The phoneInfo required for the recipient to view and sign the document. +

    The phoneInfo required for the recipient to view and sign the document. Populate with instances of Echosign::PhoneInfo

    @@ -263,13 +263,13 @@

     
     
    -14
    -15
     16
    -17
    +17 +18 +19

    -
    # File 'lib/echosign/agreement/recipient_security_option.rb', line 14
    +      
    # File 'lib/echosign/agreement/recipient_security_option.rb', line 16
     
     def initialize(params)
       require_keys([:authenticationMethod], params)
    @@ -286,7 +286,7 @@ 

    diff --git a/doc/Echosign/Refresh.html b/doc/Echosign/Refresh.html index 9e1e1d3..e1cfed4 100644 --- a/doc/Echosign/Refresh.html +++ b/doc/Echosign/Refresh.html @@ -243,6 +243,7 @@

     
     
    +10
     11
     12
     13
    @@ -251,22 +252,19 @@ 

    16 17 18 -19 -20 -21

    +19

    -
    # File 'lib/echosign/refresh.rb', line 11
    +      
    # File 'lib/echosign/refresh.rb', line 10
     
     def initialize(client_id, client_secret, refresh_token)
    -
       merge!(
    -  {
    -    :client_id => client_id,
    -    :client_secret => client_secret,
    -    :refresh_token => refresh_token,
    -    :grant_type => "refresh_token"
    -  }
    +    {
    +      client_id: client_id,
    +      client_secret: client_secret,
    +      refresh_token: refresh_token,
    +      grant_type: "refresh_token"
    +    }
       )
     end
    @@ -280,7 +278,7 @@

    diff --git a/doc/Echosign/Reminder.html b/doc/Echosign/Reminder.html index 0573d8e..d070655 100644 --- a/doc/Echosign/Reminder.html +++ b/doc/Echosign/Reminder.html @@ -269,7 +269,7 @@

    diff --git a/doc/Echosign/Request.html b/doc/Echosign/Request.html index 69798b0..d058278 100644 --- a/doc/Echosign/Request.html +++ b/doc/Echosign/Request.html @@ -91,7 +91,7 @@

    Defined Under Namespace

    - Classes: Failure + Classes: EndpointHash, Failure

    @@ -107,27 +107,30 @@

    BASE_URL =
    -
    'https://api.eu1.echosign.com/api/rest/v5'
    +
    'https://api.echosign.com/'
    -
    REFRESH_URL = +
    BASE_PATH =
    -
    'https://api.eu1.echosign.com/oauth/refresh'
    +
    'api/rest/v5'
    ENDPOINT =
    -
    { 
    -  token: BASE_URL + '/auth/tokens',
    -  refresh: REFRESH_URL,
    -  user: BASE_URL + '/users',
    -  agreement: BASE_URL + '/agreements',
    -  mega_sign: BASE_URL + '/megaSigns',
    -  reminder: BASE_URL + '/reminders',
    -  transientDocument: BASE_URL + '/transientDocuments',
    -  libraryDocument: BASE_URL + '/libraryDocuments',
    -  widget: BASE_URL + '/widgets'
    -}
    +
    EndpointHash.new({
    +  base_uri: '/base_uris',
    +  transientDocument: '/transientDocuments',
    +  agreement: '/agreements',
    +  reminder: '/reminders',
    +  user: '/users',
    +  libraryDocument: '/libraryDocuments',
    +  widget: '/widgets',
    +  view: '/views',
    +  search: '/search',
    +  workflow: '/workflows',
    +  group: '/groups',
    +  megaSign: '/megaSigns',
    +}).freeze
    @@ -149,7 +152,7 @@

  • - .agreement_combined_pdf(token, agreement_id, versionId, participantEmail, attachSupportingDocuments, auditReport) ⇒ String + .agreement_combined_pdf(token, base_uri, agreement_id, versionId, participantEmail, attachSupportingDocuments, auditReport) ⇒ String @@ -174,7 +177,7 @@

  • - .agreement_document_file(token, agreement_id, document_id) ⇒ String + .agreement_document_file(token, base_uri, agreement_id, document_id) ⇒ String @@ -198,7 +201,7 @@

  • - .agreement_documents(token, agreement_id, recipient_email = nil, format = nil, version_id = nil) ⇒ Hash + .agreement_documents(token, base_uri, agreement_id, recipient_email = nil, format = nil, version_id = nil) ⇒ Hash @@ -222,7 +225,7 @@

  • - .agreement_form_data(token, agreement_id) ⇒ String + .agreement_form_data(token, base_uri, agreement_id) ⇒ String @@ -247,7 +250,7 @@

  • - .agreement_info(token, agreement_id) ⇒ Hash + .agreement_info(token, base_uri, agreement_id) ⇒ Hash @@ -271,7 +274,7 @@

  • - .agreement_signing_urls(token, agreement_id) ⇒ Hash + .agreement_signing_urls(token, base_uri, agreement_id) ⇒ Hash @@ -295,7 +298,7 @@

  • - .audit_trail_pdf(token, mega_sign_id) ⇒ String + .audit_trail_pdf(token, base_uri, mega_sign_id) ⇒ String @@ -319,7 +322,7 @@

  • - .create_agreement(body, token, user_id = nil, user_email = nil) ⇒ Hash + .create_agreement(token, base_uri, body, user_id = nil, user_email = nil) ⇒ Hash @@ -343,7 +346,7 @@

  • - .create_mega_sign(body, token, user_id = nil, user_email = nil) ⇒ Hash + .create_mega_sign(token, base_uri, body, user_id = nil, user_email = nil) ⇒ Hash @@ -367,7 +370,7 @@

  • - .create_reminder(token, body) ⇒ Hash + .create_reminder(token, base_uri, body) ⇒ Hash @@ -391,7 +394,7 @@

  • - .create_transient_document(token, file_name, file_handle, mime_type = nil) ⇒ Hash + .create_transient_document(token, base_uri, file_name, file_handle, mime_type = nil) ⇒ Hash @@ -415,7 +418,7 @@

  • - .create_user(body, token) ⇒ Hash + .create_user(token, base_uri, body) ⇒ Hash @@ -439,7 +442,7 @@

  • - .create_widget(token, widget) ⇒ Hash + .create_widget(token, base_uri, widget) ⇒ Hash @@ -455,7 +458,7 @@

    Creates a widget and returns the Javascript snippet and URL to access the -widget and widgetID in response to the client.

    +widget and widgetID in response to the client.

  • @@ -464,7 +467,7 @@

  • - .get_agreements(token) ⇒ Hash + .get_agreements(token, base_uri) ⇒ Hash @@ -488,7 +491,7 @@

  • - .get_library_document(token, library_document_id) ⇒ Hash + .get_base_uris(token) ⇒ Object @@ -502,33 +505,7 @@

    -
    -

    Retrieves library document metadata for a user.

    -
    - -

  • - - -
  • - - - .get_library_document_file(token, library_document_id, file_id) ⇒ String - - - - - - - - - - - - - -
    -

    Retrieves library document file data.

    -
    +
  • @@ -536,7 +513,7 @@

  • - .get_library_document_files(token, library_document_id) ⇒ Hash + .get_library_document(token, base_uri, library_document_id) ⇒ Hash @@ -551,7 +528,7 @@

    -

    Retrieves library document file.

    +

    Retrieves library document metadata for a user.

  • @@ -560,7 +537,7 @@

  • - .get_library_documents(token, user_id = nil, user_email = nil) ⇒ Hash + .get_library_document_file(token, base_uri, library_document_id, file_id) ⇒ String @@ -575,7 +552,7 @@

    -

    Retrieves library documents for a user.

    +

    Retrieves library document file data.

  • @@ -584,7 +561,7 @@

  • - .get_mega_signs(token) ⇒ Hash + .get_library_document_files(token, base_uri, library_document_id) ⇒ Hash @@ -599,7 +576,7 @@

    -

    Performs REST GET /mega_signs operation.

    +

    Retrieves library document file.

  • @@ -608,7 +585,7 @@

  • - .get_token(credentials) ⇒ String + .get_library_documents(token, base_uri, user_id = nil, user_email = nil) ⇒ Hash @@ -623,7 +600,7 @@

    -

    Retrieves the authentication token.

    +

    Retrieves library documents for a user.

  • @@ -632,7 +609,7 @@

  • - .get_token_from_refresh(credentials) ⇒ String + .get_mega_signs(token, base_uri) ⇒ Hash @@ -647,7 +624,7 @@

    -

    Retrieves the authentication token.

    +

    Performs REST GET /mega_signs operation.

  • @@ -656,7 +633,7 @@

  • - .get_user(token, user_id) ⇒ Hash + .get_user(token, base_uri, user_id) ⇒ Hash @@ -680,7 +657,7 @@

  • - .get_users(token, user_email) ⇒ Hash + .get_users(token, base_uri, user_email) ⇒ Hash @@ -704,7 +681,7 @@

  • - .get_widget(token, widget_id) ⇒ Hash + .get_widget(token, base_uri, widget_id) ⇒ Hash @@ -728,7 +705,7 @@

  • - .get_widget_audit_trail(token, widget_id) ⇒ Hash + .get_widget_audit_trail(token, base_uri, widget_id) ⇒ Hash @@ -752,7 +729,7 @@

  • - .get_widget_document_file(token, widget_id, document_id) ⇒ Hash + .get_widget_document_file(token, base_uri, widget_id, document_id) ⇒ Hash @@ -776,7 +753,7 @@

  • - .get_widget_documents(token, widget_id, version_id = nil, participant_email = nil) ⇒ Hash + .get_widget_documents(token, base_uri, widget_id, version_id = nil, participant_email = nil) ⇒ Hash @@ -800,7 +777,7 @@

  • - .get_widget_form_data(token, widget_id) ⇒ Hash + .get_widget_form_data(token, base_uri, widget_id) ⇒ Hash @@ -824,7 +801,7 @@

  • - .get_widgets(token, user_id = nil, user_email = nil) ⇒ Hash + .get_widgets(token, base_uri, user_id = nil, user_email = nil) ⇒ Hash @@ -848,7 +825,7 @@

  • - .library_combined_document(token, library_document_id, auditReport) ⇒ String + .library_combined_document(token, base_uri, library_document_id, auditReport) ⇒ String @@ -872,7 +849,7 @@

  • - .library_document_audit_trail(token, library_document_id) ⇒ String + .library_document_audit_trail(token, base_uri, library_document_id) ⇒ String @@ -896,7 +873,7 @@

  • - .mega_sign_combined_pdf(token, mega_sign_id, versionId, participantEmail, attachSupportingDocuments, auditReport) ⇒ String + .mega_sign_combined_pdf(token, base_uri, mega_sign_id, versionId, participantEmail, attachSupportingDocuments, auditReport) ⇒ String @@ -921,7 +898,7 @@

  • - .mega_sign_document_file(token, mega_sign_id, document_id) ⇒ String + .mega_sign_document_file(token, base_uri, mega_sign_id, document_id) ⇒ String @@ -945,7 +922,7 @@

  • - .mega_sign_documents(token, mega_sign_id, recipient_email = nil, format = nil, version_id = nil) ⇒ Hash + .mega_sign_documents(token, base_uri, mega_sign_id, recipient_email = nil, format = nil, version_id = nil) ⇒ Hash @@ -969,7 +946,7 @@

  • - .mega_sign_form_data(token, mega_sign_id) ⇒ String + .mega_sign_form_data(token, base_uri, mega_sign_id) ⇒ String @@ -994,7 +971,7 @@

  • - .mega_sign_info(token, mega_sign_id) ⇒ Hash + .mega_sign_info(token, base_uri, mega_sign_id) ⇒ Hash @@ -1018,7 +995,7 @@

  • - .mega_sign_signing_urls(token, mega_sign_id) ⇒ Hash + .mega_sign_signing_urls(token, base_uri, mega_sign_id) ⇒ Hash @@ -1042,7 +1019,7 @@

  • - .personalize_widget(token, widget_id, personalization) ⇒ Hash + .personalize_widget(token, base_uri, widget_id, personalization) ⇒ Hash @@ -1066,7 +1043,7 @@

  • - .update_agreement_status(token, agreement_id, request_body) ⇒ Hash + .update_agreement_status(token, base_uri, agreement_id, request_body) ⇒ Hash @@ -1090,7 +1067,7 @@

  • - .update_mega_sign_status(token, mega_sign_id, request_body) ⇒ Hash + .update_mega_sign_status(token, base_uri, mega_sign_id, request_body) ⇒ Hash @@ -1114,7 +1091,7 @@

  • - .update_widget_status(token, widget_id, status) ⇒ Hash + .update_widget_status(token, base_uri, widget_id, status) ⇒ Hash @@ -1147,7 +1124,7 @@

    Class Method Details

    - .agreement_combined_pdf(token, agreement_id, versionId, participantEmail, attachSupportingDocuments, auditReport) ⇒ String + .agreement_combined_pdf(token, base_uri, agreement_id, versionId, participantEmail, attachSupportingDocuments, auditReport) ⇒ String @@ -1225,6 +1202,9 @@

     
     
    +56
    +57
    +58
     59
     60
     61
    @@ -1232,20 +1212,21 @@ 

    63 64 65 -66 -67

    +66

  • -
    # File 'lib/echosign/agreement/request.rb', line 59
    +      
    # File 'lib/echosign/agreement/request.rb', line 56
     
    -def self.agreement_combined_pdf(token, agreement_id, versionId, participantEmail, attachSupportingDocuments, auditReport)
    +def self.agreement_combined_pdf(token, base_uri, agreement_id, versionId, participantEmail,
    +                                attachSupportingDocuments, auditReport)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:agreement)}/#{agreement_id}/combinedDocument"
    +  endpoint = "#{ENDPOINT.fetch(:agreement, base_uri)}/#{agreement_id}/combinedDocument"
       endpoint << add_query(endpoint, "versionId=#{versionId}") unless versionId.nil?
       endpoint << add_query(endpoint, "participantEmail=#{participantEmail}") unless participantEmail.nil?
       endpoint << add_query(endpoint, "attachSupportingDocuments=#{attachSupportingDocuments}")
       endpoint << add_query(endpoint, "auditReport=#{auditReport}")
       response = get(endpoint, headers)
    +  response.body
     end
    @@ -1255,7 +1236,7 @@

    - .agreement_document_file(token, agreement_id, document_id) ⇒ String + .agreement_document_file(token, base_uri, agreement_id, document_id) ⇒ String @@ -1332,6 +1313,7 @@

     
     
    +84
     85
     86
     87
    @@ -1339,12 +1321,13 @@ 

    89

    -
    # File 'lib/echosign/agreement/request.rb', line 85
    +      
    # File 'lib/echosign/agreement/request.rb', line 84
     
    -def self.agreement_document_file(token, agreement_id, document_id)
    +def self.agreement_document_file(token, base_uri, agreement_id, document_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:agreement)}/#{agreement_id}/documents/#{document_id}"
    +  endpoint = "#{ENDPOINT.fetch(:agreement, base_uri)}/#{agreement_id}/documents/#{document_id}"
       response = get(endpoint, headers)
    +  response.body
     end
    @@ -1354,7 +1337,7 @@

    - .agreement_documents(token, agreement_id, recipient_email = nil, format = nil, version_id = nil) ⇒ Hash + .agreement_documents(token, base_uri, agreement_id, recipient_email = nil, format = nil, version_id = nil) ⇒ Hash @@ -1472,22 +1455,22 @@

     
     
    -109
    -110
    -111
     112
     113
     114
     115
     116
    -117
    +117 +118 +119 +120

    -
    # File 'lib/echosign/agreement/request.rb', line 109
    +      
    # File 'lib/echosign/agreement/request.rb', line 112
     
    -def self.agreement_documents(token, agreement_id, recipient_email=nil, format=nil, version_id=nil)
    +def self.agreement_documents(token, base_uri, agreement_id, recipient_email = nil, format = nil, version_id = nil)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:agreement)}/#{agreement_id}/documents"
    +  endpoint = "#{ENDPOINT.fetch(:agreement, base_uri)}/#{agreement_id}/documents"
       endpoint << add_query(endpoint, "versionId=#{version_id}") unless version_id.nil?
       endpoint << add_query(endpoint, "participantEmail=#{recipient_email}") unless version_id.nil?
       endpoint << add_query(endpoint, "supportingDocumentContentFormat=#{format}") unless format.nil?
    @@ -1502,7 +1485,7 @@ 

    - .agreement_form_data(token, agreement_id) ⇒ String + .agreement_form_data(token, base_uri, agreement_id) ⇒ String @@ -1580,18 +1563,18 @@

     
     
    +73
     74
     75
     76
    -77
    -78
    +77

    -
    # File 'lib/echosign/agreement/request.rb', line 74
    +      
    # File 'lib/echosign/agreement/request.rb', line 73
     
    -def self.agreement_form_data(token, agreement_id)
    +def self.agreement_form_data(token, base_uri, agreement_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:agreement)}/#{agreement_id}/formData"
    +  endpoint = "#{ENDPOINT.fetch(:agreement, base_uri)}/#{agreement_id}/formData"
       response = get(endpoint, headers)
     end
    @@ -1602,7 +1585,7 @@

    - .agreement_info(token, agreement_id) ⇒ Hash + .agreement_info(token, base_uri, agreement_id) ⇒ Hash @@ -1679,19 +1662,19 @@

     
     
    +32
    +33
    +34
     35
     36
    -37
    -38
    -39
    -40
    +37

    -
    # File 'lib/echosign/agreement/request.rb', line 35
    +      
    # File 'lib/echosign/agreement/request.rb', line 32
     
    -def self.agreement_info(token, agreement_id)
    +def self.agreement_info(token, base_uri, agreement_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:agreement)}/#{agreement_id}"
    +  endpoint = "#{ENDPOINT.fetch(:agreement, base_uri)}/#{agreement_id}"
       response = get(endpoint, headers)
       JSON.parse(response.body)
     end
    @@ -1703,7 +1686,7 @@

    - .agreement_signing_urls(token, agreement_id) ⇒ Hash + .agreement_signing_urls(token, base_uri, agreement_id) ⇒ Hash @@ -1780,19 +1763,19 @@

     
     
    +44
    +45
    +46
     47
     48
    -49
    -50
    -51
    -52
    +49

    -
    # File 'lib/echosign/agreement/request.rb', line 47
    +      
    # File 'lib/echosign/agreement/request.rb', line 44
     
    -def self.agreement_signing_urls(token, agreement_id)
    +def self.agreement_signing_urls(token, base_uri, agreement_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:agreement)}/#{agreement_id}/signingUrls"
    +  endpoint = "#{ENDPOINT.fetch(:agreement, base_uri)}/#{agreement_id}/signingUrls"
       response = get(endpoint, headers)
       JSON.parse(response.body)
     end
    @@ -1804,7 +1787,7 @@

    - .audit_trail_pdf(token, mega_sign_id) ⇒ String + .audit_trail_pdf(token, base_uri, mega_sign_id) ⇒ String @@ -1885,15 +1868,17 @@

    97 98 99 -100

    +100 +101
    # File 'lib/echosign/agreement/request.rb', line 96
     
    -def self.audit_trail_pdf(token, agreement_id)
    +def self.audit_trail_pdf(token, base_uri, agreement_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:agreement)}/#{agreement_id}/auditTrail"
    +  endpoint = "#{ENDPOINT.fetch(:agreement, base_uri)}/#{agreement_id}/auditTrail"
       response = get(endpoint, headers)
    +  response.body
     end
    @@ -1903,7 +1888,7 @@

    - .create_agreement(body, token, user_id = nil, user_email = nil) ⇒ Hash + .create_agreement(token, base_uri, body, user_id = nil, user_email = nil) ⇒ Hash @@ -2016,26 +2001,22 @@

     
     
    +9
     10
     11
     12
     13
     14
    -15
    -16
    -17
    -18
    +15

    -
    # File 'lib/echosign/agreement/request.rb', line 10
    +      
    # File 'lib/echosign/agreement/request.rb', line 9
     
    -def self.create_agreement(body, token, user_id=nil, user_email=nil)
    +def self.create_agreement(token, base_uri, body, user_id = nil, user_email = nil)
       headers = { 'Access-Token' => token }
    -  headers.merge!('X-User-Id' => user_id) unless user_id.nil?
    -  headers.merge!('X-User-Email' => user_email) unless user_email.nil?
    -  headers.merge!('Content-Type' => "application/json")
    -  response = HTTParty.post(ENDPOINT.fetch(:agreement), :body => body.to_json,
    -  :headers => headers)
    +  headers['X-User-Id'] = user_id unless user_id.nil?
    +  headers['X-User-Email'] = user_email unless user_email.nil?
    +  response = post(ENDPOINT.fetch(:agreement, base_uri), body, headers, json: true)
       JSON.parse(response.body)
     end
    @@ -2046,7 +2027,7 @@

    - .create_mega_sign(body, token, user_id = nil, user_email = nil) ⇒ Hash + .create_mega_sign(token, base_uri, body, user_id = nil, user_email = nil) ⇒ Hash @@ -2159,6 +2140,7 @@

     
     
    +9
     10
     11
     12
    @@ -2166,19 +2148,18 @@ 

    14 15 16 -17 -18

    +17

    -
    # File 'lib/echosign/mega_sign/request.rb', line 10
    +      
    # File 'lib/echosign/mega_sign/request.rb', line 9
     
    -def self.create_mega_sign(body, token, user_id=nil, user_email=nil)
    +def self.create_mega_sign(token, base_uri, body, user_id = nil, user_email = nil)
       headers = { 'Access-Token' => token }
    -  headers.merge!('X-User-Id' => user_id) unless user_id.nil?
    -  headers.merge!('X-User-Email' => user_email) unless user_email.nil?
    -  headers.merge!('Content-Type' => "application/json")
    -  response = HTTParty.post(ENDPOINT.fetch(:mega_sign), :body => body.to_json,
    -  :headers => headers)
    +  headers['X-User-Id'] = user_id unless user_id.nil?
    +  headers['X-User-Email'] = user_email unless user_email.nil?
    +  headers['Content-Type'] = "application/json"
    +  response = HTTParty.post(ENDPOINT.fetch(:megaSign, base_uri), body: body.to_json,
    +                                                                headers: headers)
       JSON.parse(response.body)
     end
    @@ -2189,7 +2170,7 @@

    - .create_reminder(token, body) ⇒ Hash + .create_reminder(token, base_uri, body) ⇒ Hash @@ -2266,21 +2247,21 @@

     
     
    -71
    -72
     73
     74
     75
    -76
    +76 +77 +78

    -
    # File 'lib/echosign/request.rb', line 71
    +      
    # File 'lib/echosign/request.rb', line 73
     
    -def self.create_reminder(token, body)
    -endpoint = ENDPOINT.fetch(:reminder)
    -headers = { 'Access-Token' => token}
    -response = post(endpoint, body, headers)
    -JSON.parse(response.body)
    +def self.create_reminder(token, base_uri, body)
    +  endpoint = ENDPOINT.fetch(:reminder, base_uri)
    +  headers = { 'Access-Token' => token }
    +  response = post(endpoint, body, headers)
    +  JSON.parse(response.body)
     end
    @@ -2290,7 +2271,7 @@

    - .create_transient_document(token, file_name, file_handle, mime_type = nil) ⇒ Hash + .create_transient_document(token, base_uri, file_name, file_handle, mime_type = nil) ⇒ Hash @@ -2401,8 +2382,6 @@

     
     
    -85
    -86
     87
     88
     89
    @@ -2414,30 +2393,20 @@ 

    95 96 97 -98 -99 -100 -101 -102

    +98

    -
    # File 'lib/echosign/request.rb', line 85
    +      
    # File 'lib/echosign/request.rb', line 87
     
    -def self.create_transient_document(token, file_name, file_handle, mime_type=nil)
    +def self.create_transient_document(token, base_uri, file_name, file_handle, mime_type = nil)
       headers = { 'Access-Token' => token }
    +  if file_handle.is_a?(String)
    +    raise "Cannot find file: #{file_handle}" unless File.exist?(file_handle)
     
    -  begin
    -    response = HTTParty.post( 
    -                               ENDPOINT.fetch(:transientDocument), 
    -                               { 'File-Name' => file_name, 
    -                                 'Mime-Type' => mime_type, 
    -                                 'File' => file_handle,  
    -                                 :multipart => true}, 
    -                                 headers
    -                              )
    -  rescue Exception => error
    -    raise_error(error)
    +    file_handle = File.new(file_handle)
       end
    +  body = { 'File-Name' => file_name, 'Mime-Type' => mime_type, 'File' => file_handle }
    +  response = post(ENDPOINT.fetch(:transientDocument, base_uri), body, headers)
     
       JSON.parse(response.body)
     end
    @@ -2449,7 +2418,7 @@

    - .create_user(body, token) ⇒ Hash + .create_user(token, base_uri, body) ⇒ Hash @@ -2526,19 +2495,19 @@

     
     
    -59
    -60
     61
     62
     63
    -64
    +64 +65 +66

    -
    # File 'lib/echosign/request.rb', line 59
    +      
    # File 'lib/echosign/request.rb', line 61
     
    -def self.create_user(body, token)
    -  endpoint = ENDPOINT.fetch(:user) 
    -  headers = { 'Access-Token' => token}
    +def self.create_user(token, base_uri, body)
    +  endpoint = ENDPOINT.fetch(:user, base_uri)
    +  headers = { 'Access-Token' => token }
       response = post(endpoint, body, headers)
       JSON.parse(response.body)
     end
    @@ -2550,7 +2519,7 @@

    - .create_widget(token, widget) ⇒ Hash + .create_widget(token, base_uri, widget) ⇒ Hash @@ -2560,7 +2529,10 @@

    Creates a widget and returns the Javascript snippet and URL to access the -widget and widgetID in response to the client

    +widget and widgetID in response to

    + +
    the client
    +
    @@ -2630,11 +2602,11 @@

    # File 'lib/echosign/widget/request.rb', line 8
     
    -def self.create_widget(token, widget)
    -  endpoint = ENDPOINT.fetch(:widget) 
    -  headers = { 'Access-Token' => token}
    -  headers.merge!('X-User-Id' => widget.user_id) unless widget.user_id.nil?
    -  headers.merge!('X-User-Email' => widget.user_email) unless widget.user_email.nil?
    +def self.create_widget(token, base_uri, widget)
    +  endpoint = ENDPOINT.fetch(:widget, base_uri)
    +  headers = { 'Access-Token' => token }
    +  headers['X-User-Id'] = widget.user_id unless widget.user_id.nil?
    +  headers['X-User-Email'] = widget.user_email unless widget.user_email.nil?
       response = post(endpoint, widget, headers)
       JSON.parse(response.body)
     end
    @@ -2646,7 +2618,7 @@

    - .get_agreements(token) ⇒ Hash + .get_agreements(token, base_uri) ⇒ Hash @@ -2707,18 +2679,54 @@

     
     
    +21
    +22
    +23
     24
    -25
    -26
    -27
    -28
    +25

    -
    # File 'lib/echosign/agreement/request.rb', line 24
    +      
    # File 'lib/echosign/agreement/request.rb', line 21
     
    -def self.get_agreements(token)
    +def self.get_agreements(token, base_uri)
       headers = { 'Access-Token' => token }
    -  response = get(ENDPOINT.fetch(:agreement), headers)
    +  response = get(ENDPOINT.fetch(:agreement, base_uri), headers)
    +  JSON.parse(response.body)
    +end
    + + + + + +
    +

    + + .get_base_uris(token) ⇒ Object + + + + + +

    + + + @@ -2729,7 +2737,7 @@

    - .get_library_document(token, library_document_id) ⇒ Hash + .get_library_document(token, base_uri, library_document_id) ⇒ Hash @@ -2801,19 +2809,19 @@

     
     
    -23
     24
     25
     26
     27
    -28
    +28 +29

    @@ -2940,7 +2948,7 @@

    - .get_library_document_files(token, library_document_id) ⇒ Hash + .get_library_document_files(token, base_uri, library_document_id) ⇒ Hash @@ -3017,19 +3025,19 @@

     
     
    -35
     36
     37
     38
     39
    -40
    +40 +41

    +
    +
    +
    +49
    +50
    +51
    +52
    +53
    +54
    +
    +
    # File 'lib/echosign/request.rb', line 49
    +
    +def self.get_base_uris(token)
    +  endpoint = ENDPOINT.fetch(:base_uri, BASE_URL)
    +  headers = { 'Access-Token' => token }
    +  response = get(endpoint, headers)
       JSON.parse(response.body)
     end
    -
    # File 'lib/echosign/library_documents/request.rb', line 23
    +      
    # File 'lib/echosign/library_documents/request.rb', line 24
     
    -def self.get_library_document(token, library_document_id)
    +def self.get_library_document(token, base_uri, library_document_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:libraryDocument)}/#{library_document_id}"
    +  endpoint = "#{ENDPOINT.fetch(:libraryDocument, base_uri)}/#{library_document_id}"
       response = get(endpoint, headers)
       JSON.parse(response.body)
     end
    @@ -2825,7 +2833,7 @@

    - .get_library_document_file(token, library_document_id, file_id) ⇒ String + .get_library_document_file(token, base_uri, library_document_id, file_id) ⇒ String @@ -2918,18 +2926,18 @@

     
     
    -48
     49
     50
     51
    -52
    +52 +53

    -
    # File 'lib/echosign/library_documents/request.rb', line 48
    +      
    # File 'lib/echosign/library_documents/request.rb', line 49
     
    -def self.get_library_document_file(token, library_document_id, file_id)
    +def self.get_library_document_file(token, base_uri, library_document_id, file_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:libraryDocument)}/#{library_document_id}/documents/#{file_id}"
    +  endpoint = "#{ENDPOINT.fetch(:libraryDocument, base_uri)}/#{library_document_id}/documents/#{file_id}"
       response = get(endpoint, headers)
     end
    -
    # File 'lib/echosign/library_documents/request.rb', line 35
    +      
    # File 'lib/echosign/library_documents/request.rb', line 36
     
    -def self.get_library_document_files(token, library_document_id)
    +def self.get_library_document_files(token, base_uri, library_document_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:libraryDocument)}/#{library_document_id}/documents"
    +  endpoint = "#{ENDPOINT.fetch(:libraryDocument, base_uri)}/#{library_document_id}/documents"
       response = get(endpoint, headers)
       JSON.parse(response.body)
     end
    @@ -3041,7 +3049,7 @@

    - .get_library_documents(token, user_id = nil, user_email = nil) ⇒ Hash + .get_library_documents(token, base_uri, user_id = nil, user_email = nil) ⇒ Hash @@ -3141,23 +3149,23 @@

     
     
    -9
     10
     11
     12
     13
     14
     15
    -16
    +16 +17

    -
    # File 'lib/echosign/library_documents/request.rb', line 9
    +      
    # File 'lib/echosign/library_documents/request.rb', line 10
     
    -def self.get_library_documents(token, user_id=nil, user_email=nil)
    +def self.get_library_documents(token, base_uri, user_id = nil, user_email = nil)
       headers = { 'Access-Token' => token }
    -  headers.merge!('X-User-Id' => user_id) unless user_id.nil?
    -  headers.merge!('X-User-Email' => user_email) unless user_email.nil?
    -  endpoint = ENDPOINT.fetch(:libraryDocument)
    +  headers['X-User-Id'] = user_id unless user_id.nil?
    +  headers['X-User-Email'] = user_email unless user_email.nil?
    +  endpoint = ENDPOINT.fetch(:libraryDocument, base_uri)
       response = get(endpoint, headers)
       JSON.parse(response.body)
     end
    @@ -3169,7 +3177,7 @@

    - .get_mega_signs(token) ⇒ Hash + .get_mega_signs(token, base_uri) ⇒ Hash @@ -3230,201 +3238,29 @@

     
     
    +23
     24
     25
     26
    -27
    -28
    +27

    -
    # File 'lib/echosign/mega_sign/request.rb', line 24
    +      
    # File 'lib/echosign/mega_sign/request.rb', line 23
     
    -def self.get_mega_signs(token)
    +def self.get_mega_signs(token, base_uri)
       headers = { 'Access-Token' => token }
    -  response = get(ENDPOINT.fetch(:mega_sign), headers)
    +  response = get(ENDPOINT.fetch(:megaSign, base_uri), headers)
       JSON.parse(response.body)
     end
    -
    - -
    -

    - - .get_token(credentials) ⇒ String - - - - - -

    -
    - -

    Retrieves the authentication token

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - credentials - - - (Echosign::Credentials) - - - - — -
      -

      Initialized Echosign::Credentials

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (String) - - - - — -
      -

      Valid authentication token

      -
      - -
    • - -
    - -
    - - - - -
    -
    -
    -
    -35
    -36
    -37
    -38
    -39
    -40
    -
    -
    # File 'lib/echosign/request.rb', line 35
    -
    -def self.get_token(credentials)
    -  headers = {}
    -  response = post(ENDPOINT.fetch(:token), credentials, headers)
    -  response_body = JSON.parse(response.body)
    -  response_body.fetch("access_token")
    -end
    -
    -
    - -
    -

    - - .get_token_from_refresh(credentials) ⇒ String - - - - - -

    -
    - -

    Retrieves the authentication token

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - credentials - - - (Echosign::Credentials) - - - - — -
      -

      Initialized Echosign::Credentials

      -
      - -
    • - -
    - -

    Returns:

    -
      - -
    • - - - (String) - - - - — -
      -

      Valid authentication token

      -
      - -
    • - -
    - -
    - - - - -
    -
    -
    -
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -
    -
    # File 'lib/echosign/request.rb', line 46
    -
    -def self.get_token_from_refresh(credentials)
    -  # headers = { :content_type => "application/x-www-form-urlencoded" }
    -  headers = {}
    -  response = post(ENDPOINT.fetch(:refresh), credentials, headers)
    -  response_body = JSON.parse(response.body)
    -  response_body.fetch("access_token")
    -end
    -

    - .get_user(token, user_id) ⇒ Hash + .get_user(token, base_uri, user_id) ⇒ Hash @@ -3496,21 +3332,21 @@

     
     
    +117
    +118
    +119
    +120
     121
    -122
    -123
    -124
    -125
    -126
    +122

    -
    # File 'lib/echosign/request.rb', line 121
    +      
    # File 'lib/echosign/request.rb', line 117
     
    -def self.get_user(token, user_id)
    +def self.get_user(token, base_uri, user_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:user)}/#{user_id}"
    +  endpoint = "#{ENDPOINT.fetch(:user, base_uri)}/#{user_id}"
       response = get(endpoint, headers)
    -  JSON.parse(response)
    +  JSON.parse(response.body)
     end
    @@ -3520,7 +3356,7 @@

    - .get_users(token, user_email) ⇒ Hash + .get_users(token, base_uri, user_email) ⇒ Hash @@ -3597,21 +3433,21 @@

     
     
    +105
    +106
    +107
    +108
     109
    -110
    -111
    -112
    -113
    -114
    +110

    -
    # File 'lib/echosign/request.rb', line 109
    +      
    # File 'lib/echosign/request.rb', line 105
     
    -def self.get_users(token, user_email)
    +def self.get_users(token, base_uri, user_email)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:user)}?x-user-email=#{user_email}"
    +  endpoint = "#{ENDPOINT.fetch(:user, base_uri)}?x-user-email=#{user_email}"
       response = get(endpoint, headers)
    -  JSON.parse(response)
    +  JSON.parse(response.body)
     end
    @@ -3621,7 +3457,7 @@

    - .get_widget(token, widget_id) ⇒ Hash + .get_widget(token, base_uri, widget_id) ⇒ Hash @@ -3677,19 +3513,19 @@

     
     
    -82
    -83
    -84
    -85
    -86
    -87
    +62 +63 +64 +65 +66 +67

    -
    # File 'lib/echosign/widget/request.rb', line 82
    +      
    # File 'lib/echosign/widget/request.rb', line 62
     
    -def self.get_widget(token, widget_id)
    +def self.get_widget(token, base_uri, widget_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:widget)}/#{widget_id}"
    +  endpoint = "#{ENDPOINT.fetch(:widget, base_uri)}/#{widget_id}"
       response = get(endpoint, headers)
       JSON.parse(response.body)
     end
    @@ -3701,7 +3537,7 @@

    - .get_widget_audit_trail(token, widget_id) ⇒ Hash + .get_widget_audit_trail(token, base_uri, widget_id) ⇒ Hash @@ -3757,18 +3593,18 @@

     
     
    -116
    -117
    -118
    -119
    -120
    +96 +97 +98 +99 +100

    -
    # File 'lib/echosign/widget/request.rb', line 116
    +      
    # File 'lib/echosign/widget/request.rb', line 96
     
    -def self.get_widget_audit_trail(token, widget_id)
    +def self.get_widget_audit_trail(token, base_uri, widget_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:widget)}/#{widget_id}/auditTrail"
    +  endpoint = "#{ENDPOINT.fetch(:widget, base_uri)}/#{widget_id}/auditTrail"
       response = get(endpoint, headers)
     end
    @@ -3779,7 +3615,7 @@

    - .get_widget_document_file(token, widget_id, document_id) ⇒ Hash + .get_widget_document_file(token, base_uri, widget_id, document_id) ⇒ Hash @@ -3835,18 +3671,18 @@

     
     
    -106
    -107
    -108
    -109
    -110
    +86 +87 +88 +89 +90

    -
    # File 'lib/echosign/widget/request.rb', line 106
    +      
    # File 'lib/echosign/widget/request.rb', line 86
     
    -def self.get_widget_document_file(token, widget_id, document_id)
    +def self.get_widget_document_file(token, base_uri, widget_id, document_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:widget)}/#{widget_id}/documents/#{document_id}"
    +  endpoint = "#{ENDPOINT.fetch(:widget, base_uri)}/#{widget_id}/documents/#{document_id}"
       response = get(endpoint, headers)
     end
    @@ -3857,7 +3693,7 @@

    - .get_widget_documents(token, widget_id, version_id = nil, participant_email = nil) ⇒ Hash + .get_widget_documents(token, base_uri, widget_id, version_id = nil, participant_email = nil) ⇒ Hash @@ -3913,21 +3749,21 @@

     
     
    -93
    -94
    -95
    -96
    -97
    -98
    -99
    -100
    +73 +74 +75 +76 +77 +78 +79 +80

    -
    # File 'lib/echosign/widget/request.rb', line 93
    +      
    # File 'lib/echosign/widget/request.rb', line 73
     
    -def self.get_widget_documents(token, widget_id, version_id=nil, participant_email=nil)
    +def self.get_widget_documents(token, base_uri, widget_id, version_id = nil, participant_email = nil)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:widget)}/#{widget_id}/documents"
    +  endpoint = "#{ENDPOINT.fetch(:widget, base_uri)}/#{widget_id}/documents"
       endpoint << add_query(endpoint, "versionId=#{version_id}") unless version_id.nil?
       endpoint << add_query(endpoint, "participantEmail=#{participant_email}") unless participant_email.nil?
       response = get(endpoint, headers)
    @@ -3941,7 +3777,7 @@ 

    - .get_widget_form_data(token, widget_id) ⇒ Hash + .get_widget_form_data(token, base_uri, widget_id) ⇒ Hash @@ -3997,18 +3833,18 @@

     
     
    -126
    -127
    -128
    -129
    -130
    +106 +107 +108 +109 +110

    -
    # File 'lib/echosign/widget/request.rb', line 126
    +      
    # File 'lib/echosign/widget/request.rb', line 106
     
    -def self.get_widget_form_data(token, widget_id)
    +def self.get_widget_form_data(token, base_uri, widget_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:widget)}/#{widget_id}/formData"
    +  endpoint = "#{ENDPOINT.fetch(:widget, base_uri)}/#{widget_id}/formData"
       response = get(endpoint, headers)
     end
    @@ -4019,7 +3855,7 @@

    - .get_widgets(token, user_id = nil, user_email = nil) ⇒ Hash + .get_widgets(token, base_uri, user_id = nil, user_email = nil) ⇒ Hash @@ -4106,23 +3942,23 @@

     
     
    -69
    -70
    -71
    -72
    -73
    -74
    -75
    -76
    +49 +50 +51 +52 +53 +54 +55 +56

    -
    # File 'lib/echosign/widget/request.rb', line 69
    +      
    # File 'lib/echosign/widget/request.rb', line 49
     
    -def self.get_widgets(token, user_id=nil, user_email=nil)
    +def self.get_widgets(token, base_uri, user_id = nil, user_email = nil)
       headers = { 'Access-Token' => token }
    -  headers.merge!('X-User-Id' => user_id) unless user_id.nil?
    -  headers.merge!('X-User-Email' => user_email) unless user_email.nil?
    -  endpoint = "#{ENDPOINT.fetch(:widget)}"
    +  headers['X-User-Id'] = user_id unless user_id.nil?
    +  headers['X-User-Email'] = user_email unless user_email.nil?
    +  endpoint = "#{ENDPOINT.fetch(:widget, base_uri)}"
       response = get(endpoint, headers)
       JSON.parse(response.body)
     end
    @@ -4134,7 +3970,7 @@

    - .library_combined_document(token, library_document_id, auditReport) ⇒ String + .library_combined_document(token, base_uri, library_document_id, auditReport) ⇒ String @@ -4211,20 +4047,20 @@

     
     
    -70
     71
     72
     73
     74
    -75
    +75 +76

    -
    # File 'lib/echosign/library_documents/request.rb', line 70
    +      
    # File 'lib/echosign/library_documents/request.rb', line 71
     
    -def self.library_combined_document(token, library_document_id, auditReport)
    +def self.library_combined_document(token, base_uri, library_document_id, auditReport)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:libraryDocument)}/#{library_document_id}/combinedDocument"
    -  endpoint << add_query(endpoint, "auditReport=#{auditReport}") 
    +  endpoint = "#{ENDPOINT.fetch(:libraryDocument, base_uri)}/#{library_document_id}/combinedDocument"
    +  endpoint << add_query(endpoint, "auditReport=#{auditReport}")
       response = get(endpoint, headers)
     end
    @@ -4235,7 +4071,7 @@

    - .library_document_audit_trail(token, library_document_id) ⇒ String + .library_document_audit_trail(token, base_uri, library_document_id) ⇒ String @@ -4312,18 +4148,18 @@

     
     
    -59
     60
     61
     62
    -63
    +63 +64

    -
    # File 'lib/echosign/library_documents/request.rb', line 59
    +      
    # File 'lib/echosign/library_documents/request.rb', line 60
     
    -def self.library_document_audit_trail(token, library_document_id)
    +def self.library_document_audit_trail(token, base_uri, library_document_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:libraryDocument)}/#{library_document_id}/auditTrail"
    +  endpoint = "#{ENDPOINT.fetch(:libraryDocument, base_uri)}/#{library_document_id}/auditTrail"
       response = get(endpoint, headers)
     end
    @@ -4334,7 +4170,7 @@

    - .mega_sign_combined_pdf(token, mega_sign_id, versionId, participantEmail, attachSupportingDocuments, auditReport) ⇒ String + .mega_sign_combined_pdf(token, base_uri, mega_sign_id, versionId, participantEmail, attachSupportingDocuments, auditReport) ⇒ String @@ -4412,6 +4248,7 @@

     
     
    +58
     59
     60
     61
    @@ -4423,11 +4260,12 @@ 

    67

    -
    # File 'lib/echosign/mega_sign/request.rb', line 59
    +      
    # File 'lib/echosign/mega_sign/request.rb', line 58
     
    -def self.mega_sign_combined_pdf(token, mega_sign_id, versionId, participantEmail, attachSupportingDocuments, auditReport)
    +def self.mega_sign_combined_pdf(token, base_uri, mega_sign_id, versionId, participantEmail,
    +                                attachSupportingDocuments, auditReport)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:mega_sign)}/#{mega_sign_id}/combinedDocument"
    +  endpoint = "#{ENDPOINT.fetch(:megaSign, base_uri)}/#{mega_sign_id}/combinedDocument"
       endpoint << add_query(endpoint, "versionId=#{versionId}") unless versionId.nil?
       endpoint << add_query(endpoint, "participantEmail=#{participantEmail}") unless participantEmail.nil?
       endpoint << add_query(endpoint, "attachSupportingDocuments=#{attachSupportingDocuments}")
    @@ -4442,7 +4280,7 @@ 

    - .mega_sign_document_file(token, mega_sign_id, document_id) ⇒ String + .mega_sign_document_file(token, base_uri, mega_sign_id, document_id) ⇒ String @@ -4528,9 +4366,9 @@

    # File 'lib/echosign/mega_sign/request.rb', line 85
     
    -def self.mega_sign_document_file(token, mega_sign_id, document_id)
    +def self.mega_sign_document_file(token, base_uri, mega_sign_id, document_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:mega_sign)}/#{mega_sign_id}/documents/#{document_id}"
    +  endpoint = "#{ENDPOINT.fetch(:megaSign, base_uri)}/#{mega_sign_id}/documents/#{document_id}"
       response = get(endpoint, headers)
     end
    @@ -4541,7 +4379,7 @@

    - .mega_sign_documents(token, mega_sign_id, recipient_email = nil, format = nil, version_id = nil) ⇒ Hash + .mega_sign_documents(token, base_uri, mega_sign_id, recipient_email = nil, format = nil, version_id = nil) ⇒ Hash @@ -4659,22 +4497,22 @@

     
     
    -109
    -110
     111
     112
     113
     114
     115
     116
    -117
    +117 +118 +119

    -
    # File 'lib/echosign/mega_sign/request.rb', line 109
    +      
    # File 'lib/echosign/mega_sign/request.rb', line 111
     
    -def self.mega_sign_documents(token, mega_sign_id, recipient_email=nil, format=nil, version_id=nil)
    +def self.mega_sign_documents(token, base_uri, mega_sign_id, recipient_email = nil, format = nil, version_id = nil)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:mega_sign)}/#{mega_sign_id}/documents"
    +  endpoint = "#{ENDPOINT.fetch(:megaSign, base_uri)}/#{mega_sign_id}/documents"
       endpoint << add_query(endpoint, "versionId=#{version_id}") unless version_id.nil?
       endpoint << add_query(endpoint, "participantEmail=#{recipient_email}") unless version_id.nil?
       endpoint << add_query(endpoint, "supportingDocumentContentFormat=#{format}") unless format.nil?
    @@ -4689,7 +4527,7 @@ 

    - .mega_sign_form_data(token, mega_sign_id) ⇒ String + .mega_sign_form_data(token, base_uri, mega_sign_id) ⇒ String @@ -4776,9 +4614,9 @@

    # File 'lib/echosign/mega_sign/request.rb', line 74
     
    -def self.mega_sign_form_data(token, mega_sign_id)
    +def self.mega_sign_form_data(token, base_uri, mega_sign_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:mega_sign)}/#{mega_sign_id}/formData"
    +  endpoint = "#{ENDPOINT.fetch(:megaSign, base_uri)}/#{mega_sign_id}/formData"
       response = get(endpoint, headers)
     end
    @@ -4789,7 +4627,7 @@

    - .mega_sign_info(token, mega_sign_id) ⇒ Hash + .mega_sign_info(token, base_uri, mega_sign_id) ⇒ Hash @@ -4866,19 +4704,19 @@

     
     
    +34
     35
     36
     37
     38
    -39
    -40
    +39

    -
    # File 'lib/echosign/mega_sign/request.rb', line 35
    +      
    # File 'lib/echosign/mega_sign/request.rb', line 34
     
    -def self.mega_sign_info(token, mega_sign_id)
    +def self.mega_sign_info(token, base_uri, mega_sign_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:mega_sign)}/#{mega_sign_id}"
    +  endpoint = "#{ENDPOINT.fetch(:megaSign, base_uri)}/#{mega_sign_id}"
       response = get(endpoint, headers)
       JSON.parse(response.body)
     end
    @@ -4890,7 +4728,7 @@

    - .mega_sign_signing_urls(token, mega_sign_id) ⇒ Hash + .mega_sign_signing_urls(token, base_uri, mega_sign_id) ⇒ Hash @@ -4967,19 +4805,19 @@

     
     
    +46
     47
     48
     49
     50
    -51
    -52
    +51

    -
    # File 'lib/echosign/mega_sign/request.rb', line 47
    +      
    # File 'lib/echosign/mega_sign/request.rb', line 46
     
    -def self.mega_sign_signing_urls(token, mega_sign_id)
    +def self.mega_sign_signing_urls(token, base_uri, mega_sign_id)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:mega_sign)}/#{mega_sign_id}/signingUrls"
    +  endpoint = "#{ENDPOINT.fetch(:megaSign, base_uri)}/#{mega_sign_id}/signingUrls"
       response = get(endpoint, headers)
       JSON.parse(response.body)
     end
    @@ -4991,7 +4829,7 @@

    - .personalize_widget(token, widget_id, personalization) ⇒ Hash + .personalize_widget(token, base_uri, widget_id, personalization) ⇒ Hash @@ -5079,35 +4917,15 @@

    25 26 27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38

    +28
    # File 'lib/echosign/widget/request.rb', line 23
     
    -def self.personalize_widget(token, widget_id, personalization)
    +def self.personalize_widget(token, base_uri, widget_id, personalization)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:widget)}/#{widget_id}/personalize"
    -
    -  begin
    -    response = HTTParty.put(
    -      endpoint, 
    -      personalization.to_json,
    -      headers
    -    )
    -  rescue Exception => error
    -    raise_error(error)
    -  end
    -
    +  endpoint = "#{ENDPOINT.fetch(:widget, base_uri)}/#{widget_id}/personalize"
    +  response = put(endpoint, personalization.to_json, headers)
       JSON.parse(response.body)
     end
    @@ -5118,7 +4936,7 @@

    - .update_agreement_status(token, agreement_id, request_body) ⇒ Hash + .update_agreement_status(token, base_uri, agreement_id, request_body) ⇒ Hash @@ -5211,40 +5029,20 @@

     
     
    -126
    -127
     128
     129
     130
     131
     132
    -133
    -134
    -135
    -136
    -137
    -138
    -139
    -140
    -141
    +133

    -
    # File 'lib/echosign/agreement/request.rb', line 126
    +      
    # File 'lib/echosign/agreement/request.rb', line 128
     
    -def self.update_agreement_status(token, agreement_id, request_body)
    +def self.update_agreement_status(token, base_uri, agreement_id, request_body)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:agreement)}/#{agreement_id}/status"
    -
    -  begin
    -    response = HTTParty.put(
    -      endpoint, 
    -      request_body.to_json,
    -      headers
    -    )
    -  rescue Exception => error
    -    raise_error(error)
    -  end
    -
    +  endpoint = "#{ENDPOINT.fetch(:agreement, base_uri)}/#{agreement_id}/status"
    +  response = put(endpoint, request_body.to_json, headers)
       JSON.parse(response.body)
     end
    @@ -5255,7 +5053,7 @@

    - .update_mega_sign_status(token, mega_sign_id, request_body) ⇒ Hash + .update_mega_sign_status(token, base_uri, mega_sign_id, request_body) ⇒ Hash @@ -5348,40 +5146,20 @@

     
     
    -126
     127
     128
     129
     130
     131
    -132
    -133
    -134
    -135
    -136
    -137
    -138
    -139
    -140
    -141
    +132

    -
    # File 'lib/echosign/mega_sign/request.rb', line 126
    +      
    # File 'lib/echosign/mega_sign/request.rb', line 127
     
    -def self.update_mega_sign_status(token, mega_sign_id, request_body)
    +def self.update_mega_sign_status(token, base_uri, mega_sign_id, request_body)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:mega_sign)}/#{mega_sign_id}/status"
    -
    -  begin
    -    response = HTTParty.put(
    -      endpoint, 
    -      request_body.to_json,
    -      headers
    -    )
    -  rescue Exception => error
    -    raise_error(error)
    -  end
    -
    +  endpoint = "#{ENDPOINT.fetch(:megaSign, base_uri)}/#{mega_sign_id}/status"
    +  response = put(endpoint, request_body.to_json, headers)
       JSON.parse(response.body)
     end
    @@ -5392,7 +5170,7 @@

    - .update_widget_status(token, widget_id, status) ⇒ Hash + .update_widget_status(token, base_uri, widget_id, status) ⇒ Hash @@ -5475,40 +5253,20 @@

     
     
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    +36 +37 +38 +39 +40 +41

    -
    # File 'lib/echosign/widget/request.rb', line 46
    +      
    # File 'lib/echosign/widget/request.rb', line 36
     
    -def self.update_widget_status(token, widget_id, status)
    +def self.update_widget_status(token, base_uri, widget_id, status)
       headers = { 'Access-Token' => token }
    -  endpoint = "#{ENDPOINT.fetch(:widget)}/#{widget_id}/status"
    -
    -  begin
    -    response = HTTParty.put(
    -      endpoint, 
    -      status.to_json,
    -      headers 
    -    )
    -  rescue Exception => error
    -    raise_error(error)
    -  end
    -
    +  endpoint = "#{ENDPOINT.fetch(:widget, base_uri)}/#{widget_id}/status"
    +  response = put(endpoint, status.to_json, headers)
       JSON.parse(response.body)
     end
    @@ -5521,7 +5279,7 @@

    diff --git a/doc/Echosign/Request/EndpointHash.html b/doc/Echosign/Request/EndpointHash.html new file mode 100644 index 0000000..3768aba --- /dev/null +++ b/doc/Echosign/Request/EndpointHash.html @@ -0,0 +1,328 @@ + + + + + + + Class: Echosign::Request::EndpointHash + + — Documentation by YARD 0.9.16 + + + + + + + + + + + + + + + + + + + +
    + + +

    Class: Echosign::Request::EndpointHash + + + +

    +
    + +
    +
    Inherits:
    +
    + Object + +
      +
    • Object
    • + + + +
    + show all + +
    +
    + + + + + + + + + + + +
    +
    Defined in:
    +
    lib/echosign/request.rb
    +
    + +
    + + + + + + + + + +

    + Instance Method Summary + collapse +

    + + + + +
    +

    Constructor Details

    + +
    +

    + + #initialize(paths) ⇒ EndpointHash + + + + + +

    +
    + +

    Returns a new instance of EndpointHash

    + + +
    +
    +
    + + +
    + + + + +
    +
    +
    +
    +20
    +21
    +22
    +
    +
    # File 'lib/echosign/request.rb', line 20
    +
    +def initialize(paths)
    +  @paths = paths
    +end
    +
    +
    + +
    + + +
    +

    Instance Method Details

    + + +
    +

    + + #fetch(endpoint, base_uri) ⇒ String + + + + + +

    +
    + +

    Get an endpoint by name, using the given base_uri

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + endpoint + + + (Symbol) + + + + — +
      +

      A legal endpoint name, as a symbol

      +
      + +
    • + +
    • + + base_uri + + + (String) + + + + — +
      +

      A URI that was retrieved from the base_uris API

      +
      + +
    • + +
    + +

    Returns:

    +
      + +
    • + + + (String) + + + + — +
      +

      Returns a URL for the endpoint that begins with the base_uri

      +
      + +
    • + +
    + +
    + + + + +
    +
    +
    +
    +29
    +30
    +31
    +
    +
    # File 'lib/echosign/request.rb', line 29
    +
    +def fetch(endpoint, base_uri)
    +  File.join(base_uri, BASE_PATH, @paths.fetch(endpoint))
    +end
    +
    +
    + +
    + +
    + + + +
    + + \ No newline at end of file diff --git a/doc/Echosign/Request/Failure.html b/doc/Echosign/Request/Failure.html index be9e0fd..bbded39 100644 --- a/doc/Echosign/Request/Failure.html +++ b/doc/Echosign/Request/Failure.html @@ -280,7 +280,7 @@

    diff --git a/doc/Echosign/RequestFormField.html b/doc/Echosign/RequestFormField.html index ea4e259..fbbf8a7 100644 --- a/doc/Echosign/RequestFormField.html +++ b/doc/Echosign/RequestFormField.html @@ -211,13 +211,13 @@

     
     
    +9
     10
     11
    -12
    -13
    +12

    -
    # File 'lib/echosign/agreement/request_form_field.rb', line 10
    +      
    # File 'lib/echosign/agreement/request_form_field.rb', line 9
     
     def initialize(params)
       require_keys([:locations, :name], params)
    @@ -234,7 +234,7 @@ 

    diff --git a/doc/Echosign/RequiredParameterError.html b/doc/Echosign/RequiredParameterError.html index d2c0d42..2e85914 100644 --- a/doc/Echosign/RequiredParameterError.html +++ b/doc/Echosign/RequiredParameterError.html @@ -114,7 +114,7 @@ diff --git a/doc/Echosign/UrlFileInfo.html b/doc/Echosign/UrlFileInfo.html index 63e5d3d..e71c2ea 100644 --- a/doc/Echosign/UrlFileInfo.html +++ b/doc/Echosign/UrlFileInfo.html @@ -264,13 +264,13 @@

     
     
    -12
    -13
    -14
    -15
    +15 +16 +17 +18

    -
    # File 'lib/echosign/agreement/url_file_info.rb', line 12
    +      
    # File 'lib/echosign/agreement/url_file_info.rb', line 15
     
     def initialize(params)
       require_keys([:url], params)
    @@ -287,7 +287,7 @@ 

    diff --git a/doc/Echosign/User.html b/doc/Echosign/User.html index 9c64ecb..57583ea 100644 --- a/doc/Echosign/User.html +++ b/doc/Echosign/User.html @@ -389,13 +389,13 @@

     
     
    -23
    -24
    -25
    -26
    +30 +31 +32 +33

    -
    # File 'lib/echosign/user.rb', line 23
    +      
    # File 'lib/echosign/user.rb', line 30
     
     def initialize(params)
       require_keys([:firstName, :lastName, :email, :password], params)
    @@ -412,7 +412,7 @@ 

    diff --git a/doc/Echosign/Validatable.html b/doc/Echosign/Validatable.html index 6491a98..149055e 100644 --- a/doc/Echosign/Validatable.html +++ b/doc/Echosign/Validatable.html @@ -218,6 +218,8 @@

     
     
    +12
    +13
     14
     15
     16
    @@ -228,25 +230,23 @@ 

    21 22 23 -24 -25 -26

    +24

    -
    # File 'lib/echosign/validatable.rb', line 14
    +      
    # File 'lib/echosign/validatable.rb', line 12
     
     def require_exactly_one(field_group, params)
       set_fields = 0
       field_group.each do |field|
         begin
    -      validate_field(field, params) 
    +      validate_field(field, params)
         rescue RequiredParameterError
           next
         else
           set_fields += 1
         end
       end
    -  raise ParameterError, "Exactly one of #{field_group.to_s} should be present" if set_fields != 1
    +  raise ParameterError, "Exactly one of #{field_group} should be present" if set_fields != 1
     end
    @@ -268,18 +268,18 @@

     
     
    +6
    +7
     8
     9
    -10
    -11
    -12
    +10

    -
    # File 'lib/echosign/validatable.rb', line 8
    +      
    # File 'lib/echosign/validatable.rb', line 6
     
     def require_keys(required_fields, params)
       required_fields.each do |field|
    -    validate_field(field, params) 
    +    validate_field(field, params)
       end
     end
    @@ -300,9 +300,8 @@

    TODO (bernardworthy) A validator accepting a block for conditional -execution might be useful.

    - -

    Maybe require_keys should accept a block. Figure out later.

    +execution might be useful. Maybe require_keys should accept a block. +Figure out later.

    @@ -316,17 +315,17 @@

     
     
    +30
    +31
     32
     33
     34
     35
     36
    -37
    -38
    -39
    +37

    -
    # File 'lib/echosign/validatable.rb', line 32
    +      
    # File 'lib/echosign/validatable.rb', line 30
     
     def validate_field(field, params)
       begin
    @@ -346,7 +345,7 @@ 

    diff --git a/doc/Echosign/Widget.html b/doc/Echosign/Widget.html index 1948249..a5408a6 100644 --- a/doc/Echosign/Widget.html +++ b/doc/Echosign/Widget.html @@ -187,7 +187,7 @@

  • - #initialize(user_id = nil, user_email = nil, name, fileInfos, signatureFlow, widget_completion_info) ⇒ Widget + #initialize(user_id = nil, user_email = nil, params) ⇒ Widget @@ -231,7 +231,7 @@

    Constructor Details

    - #initialize(user_id = nil, user_email = nil, name, fileInfos, signatureFlow, widget_completion_info) ⇒ Widget + #initialize(user_id = nil, user_email = nil, params) ⇒ Widget @@ -329,12 +329,195 @@

    - - - - - - +

    Options Hash (params):

    +
      + +
    • + :name + (String) + + + + + —
      +

      The name of the widget that will be used to identify it, in emails and on +the website (REQUIRED)

      +
      + +
    • + +
    • + :fileInfos + (Array) + + + + + —
      +

      Populate with instances of Echosign::Fileinfo. A list +of one or more files (or references to files) that will be used to create +the widget. If more than one file is provided, they will be combined before +the widget is created. Library documents are not permitted. Note: Only one +of the four parameters in every Fileinfo object must be specified +(REQUIRED)

      +
      + +
    • + +
    • + :formFieldLayerTemplates + (Array) + + + + + —
      +

      Populate with instances of Echosign::Fileinfo. +Specifies the form field layer template or source of form fields to apply +on the files in this transaction. If specified, the FileInfo for this +parameter must refer to a form field layer template via libraryDocumentId +or libraryDocumentName, or if specified via transientDocumentId or +documentURL, it must be of a supported file type. Note: Only one of the +four parameters in every FileInfo object must be specified.

      +
      + +
    • + +
    • + :widgetCompletionInfo + (Echosign::WidgetCompletionInfo) + + + + + —
      +

      URL and associated properties for the success page the user will be taken +to after filling out the widget

      +
      + +
    • + +
    • + :callbackInfo + (String) + + + + + —
      +

      A publicly accessible url to which EchoSign will perform an HTTP PUT +operation with the final signed PDF file. HTTP authentication is supported +using standard embedded syntax - i.e. username:password@your.server.com/path/to/file. +EchoSign can also communicate with your system using HTTP GET, every time +there is a new agreement event. Please contact support@echosign.com if you +wish to use this option.

      +
      + +
    • + +
    • + :securityOptions + (Echosign::WidgetSecurityOption) + + + + + —
      +

      Sets optional secondary security parameters for your widget

      +
      + +
    • + +
    • + :locale + (String) + + + + + —
      +

      The locale associated with this widget - specifies the language for the +signing page and emails, for example en_US or fr_FR. If none specified, +defaults to the language configured for the widget creator

      +
      + +
    • + +
    • + :counterSigners + (Echosign::CounterSignerInfo) + + + + + —
      +

      A list of one or more counter signers

      +
      + +
    • + +
    • + :vaultingInfo + (Echosign::WidgetVaultingInfo) + + + + + —
      +

      Sets the vaulting properties that allows EchoSign to securely store +documents with a vault provider

      +
      + +
    • + +
    • + :mergeFieldInfo + (Echosign::WidgetMergefieldInfo) + + + + + —
      +

      Optional default values for fields to merge into the document. The values +will be presented to the signers for editable fields; for read-only fields +the provided values will not be editable during the signing process. +Merging data into fields is currently not supported when used with +libraryDocumentId or libraryDocumentName. Only file and url are curently +supported

      +
      + +
    • + +
    • + :widgetAuthFailureInfo + (Echosign::WidgetCompletionInfo) + + + + + —
      +

      URL and associated properties for the error page the user will be taken +after failing to authenticate

      +
      + +
    • + +
    • + :widgetSignerSecurityOptions + (Echosign::WidgetSignerSecurityOption) + + + + + —
      +

      Security options that apply to widget signers

      +
      + +
    • + +
    +

    @@ -343,33 +526,6 @@

     
     
    -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
    @@ -483,14 +639,41 @@ 

    170 171 172 -173

    +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200

    @@ -667,12 +850,12 @@

     
     
    +12
     13
    -14
    -15
    +14

    @@ -313,7 +313,7 @@

    diff --git a/doc/Echosign/WidgetPersonalization.html b/doc/Echosign/WidgetPersonalization.html index 5ed20c9..3c03894 100644 --- a/doc/Echosign/WidgetPersonalization.html +++ b/doc/Echosign/WidgetPersonalization.html @@ -180,8 +180,10 @@

    Initialization object

    expiration (date, optional): Expiration date for the personalization of -this widget. After this date, the identity of the signer will not be -assumed by EchoSign.,

    +this widget. After this date, the

    + +
    identity of the signer will not be assumed by EchoSign.,
    +
    @@ -295,13 +297,13 @@

     
     
    -15
    -16
    -17
    -18
    +18 +19 +20 +21

    -
    # File 'lib/echosign/widget.rb', line 33
    +      
    # File 'lib/echosign/widget.rb', line 60
     
    -def initialize(user_id=nil, user_email=nil, name, fileInfos, signatureFlow, widget_completion_info)
    -  # require_keys([:name, :fileInfos, :signatureFlow], params)
    -  @user_id = user_id
    +def initialize(user_id = nil, user_email = nil, params)
    +  require_keys([:name, :fileInfos, :signatureFlow], params)
    +  @user_id = user_id
       @user_email = user_email
     
       # {
    @@ -619,15 +802,15 @@ 

    # "signatureFlow": "" # } # } - - merge!({ - widgetCreationInfo: { - name: name, - fileInfos: fileInfos, - signatureFlow: signatureFlow, - widgetCompletion_Info: widget_completion_info - } - }) + + merge!({ + widgetCreationInfo: { + name: params[:name], + fileInfos: params[:fileInfos], + signatureFlow: params[:signatureFlow], + widgetCompletion_Info: params[:widget_completion_info] + } + }) end

    -
    # File 'lib/echosign/widget.rb', line 13
    +      
    # File 'lib/echosign/widget.rb', line 12
     
     def user_email
       @user_email
    @@ -710,12 +893,12 @@ 

     
     
    +12
     13
    -14
    -15
    +14

    -
    # File 'lib/echosign/widget.rb', line 13
    +      
    # File 'lib/echosign/widget.rb', line 12
     
     def user_id
       @user_id
    @@ -731,7 +914,7 @@ 

    diff --git a/doc/Echosign/WidgetCompletionInfo.html b/doc/Echosign/WidgetCompletionInfo.html index edb6c6a..4196ad0 100644 --- a/doc/Echosign/WidgetCompletionInfo.html +++ b/doc/Echosign/WidgetCompletionInfo.html @@ -278,28 +278,28 @@

     
     
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    +24 +25 +26 +27 +28 +29 +30 +31 +32 +33

    -
    # File 'lib/echosign/widget/widget_completion_info.rb', line 12
    +      
    # File 'lib/echosign/widget/widget_completion_info.rb', line 24
     
     def initialize(params)
       require_keys([:url])
       merge!(
    -  {
    -    :deframe => deframe,
    -    :delay => delay,
    -    :url => url,
    -  }
    +    {
    +      deframe: deframe,
    +      delay: delay,
    +      url: url,
    +    }
       )
     end
    -
    # File 'lib/echosign/widget/widget_personalization.rb', line 15
    +      
    # File 'lib/echosign/widget/widget_personalization.rb', line 18
     
     def initialize(params)
       require_keys([:email], params)
    @@ -318,7 +320,7 @@ 

    diff --git a/doc/Echosign/WidgetSecurityOption.html b/doc/Echosign/WidgetSecurityOption.html index 6d55d47..3348642 100644 --- a/doc/Echosign/WidgetSecurityOption.html +++ b/doc/Echosign/WidgetSecurityOption.html @@ -330,12 +330,12 @@

     
     
    -16
    -17
    -18
    +28 +29 +30

    -
    # File 'lib/echosign/widget/widget_security_option.rb', line 16
    +      
    # File 'lib/echosign/widget/widget_security_option.rb', line 28
     
     def initialize(params)
       merge!(params)
    @@ -351,7 +351,7 @@ 

    diff --git a/doc/Echosign/WidgetSignerSecurityOption.html b/doc/Echosign/WidgetSignerSecurityOption.html index 75eec84..4a74373 100644 --- a/doc/Echosign/WidgetSignerSecurityOption.html +++ b/doc/Echosign/WidgetSignerSecurityOption.html @@ -265,13 +265,13 @@

     
     
    -12
    -13
    -14
    -15
    +15 +16 +17 +18

    -
    # File 'lib/echosign/widget/widget_signer_security_option.rb', line 12
    +      
    # File 'lib/echosign/widget/widget_signer_security_option.rb', line 15
     
     def initialize(params)
       require_keys([:authenticationMethod], params)
    @@ -288,7 +288,7 @@ 

    diff --git a/doc/Echosign/WidgetStatus.html b/doc/Echosign/WidgetStatus.html index 1f334f8..c8585fc 100644 --- a/doc/Echosign/WidgetStatus.html +++ b/doc/Echosign/WidgetStatus.html @@ -281,14 +281,14 @@

     
     
    -13
    -14
    -15
     16
    -17
    +17 +18 +19 +20

    -
    # File 'lib/echosign/widget/widget_status.rb', line 13
    +      
    # File 'lib/echosign/widget/widget_status.rb', line 16
     
     def initialize(params)
       require_keys([:value], params)
    @@ -306,7 +306,7 @@ 

    diff --git a/doc/Echosign/WidgetVaultingInfo.html b/doc/Echosign/WidgetVaultingInfo.html index 03662ee..2943dd9 100644 --- a/doc/Echosign/WidgetVaultingInfo.html +++ b/doc/Echosign/WidgetVaultingInfo.html @@ -257,7 +257,7 @@

    diff --git a/doc/_index.html b/doc/_index.html index f4b19a9..676f810 100644 --- a/doc/_index.html +++ b/doc/_index.html @@ -129,6 +129,13 @@

    Namespace Listing A-Z

    +
  • + EndpointHash + + (Echosign::Request) + +
  • + @@ -361,7 +368,7 @@

    Namespace Listing A-Z

    diff --git a/doc/class_list.html b/doc/class_list.html index f16c980..c077f6b 100644 --- a/doc/class_list.html +++ b/doc/class_list.html @@ -43,7 +43,7 @@

    Class List

    diff --git a/doc/file.README.html b/doc/file.README.html index 3572f9b..a90b6ce 100644 --- a/doc/file.README.html +++ b/doc/file.README.html @@ -58,6 +58,9 @@
    +

    +

    echosign

    Ruby Gem to consume Adobe's EchoSign e-signature service - REST service @@ -71,11 +74,11 @@

    Installation

    Documentation

    The bulk of the API is on the Echosign::Client +href="http://rdoc.info/github/chamberflag/echosign/frames/Echosign/Client">Echosign::Client class

    You can read Echosign's full API +href="http://rdoc.info/github/chamberflag/echosign/frames">API Documentation

    It wouldn't hurt to read Adobe's Documentation

    Usage

    -

    Initializing a client

    +

    Initializing a client with an existing refresh token

    + +
    require 'echosign'
    +
    +credentials = Echosign::Credentials.new(app_id, app_secret)
    +access_token = credentials.refresh_access_token(refresh_token)
    +
    +client = Echosign::Client.new(access_token)
    +
    + +

    Initializing a client with an authorization code

    + +

    Workflow before authorizing: - redirect_uri must be set in the +EchoSign API configuration - scope will typically be something +like 'agreement_write:account agreement_send:account'

    require 'echosign'
     
    -credentials = Echosign::Refresh.new(app_id, app_secret, refresh_token)
    +credentials = Echosign::Credentials.new(app_id, app_secret)
    +redirect_to credentials.authorize_url(redirect_uri, scope)
    +
    + +

    Workflow after authorizing: “` require 'echosign'

    + +

    credentials = Echosign::Credentials.new(app_id, app_secret) token = credentials.get_token(params, redirect_uri)

    + +

    you should persist credentials.refresh_token somewhere to use in future

    + +

    client = Echosign::Client.new(token) “`

    + +

    Initializing a client with a legacy integration key

    + +
    require 'echosign'
     
    -client = Echosign::Client.new(credentials)
    +client = Echosign::Client.new(integration_key)
     

    Setting up a new agreement from a URL

    @@ -109,9 +141,9 @@

    Setting up a new agreement role: 'SIGNER', email: 'superguy@whatsit.com' } -agreement_info_params = { +agreement_info = { fileInfos: [ Echosign::Fileinfo.new(file_info_params) ], - recipients: [ Echosign::Recipient.new(recipient_params)], + recipientSetInfos: [ Echosign::Recipient.new(recipient_params)], signatureFlow: "SENDER_SIGNS_LAST", signatureType: "ESIGN", name: "Rumplestiltskin Contract" @@ -149,7 +181,7 @@

    Sending a transie

    diff --git a/doc/index.html b/doc/index.html index 03e846d..4fdfc76 100644 --- a/doc/index.html +++ b/doc/index.html @@ -58,6 +58,9 @@
    +

    +

    echosign

    Ruby Gem to consume Adobe's EchoSign e-signature service - REST service @@ -71,11 +74,11 @@

    Installation

    Documentation

    The bulk of the API is on the Echosign::Client +href="http://rdoc.info/github/chamberflag/echosign/frames/Echosign/Client">Echosign::Client class

    You can read Echosign's full API +href="http://rdoc.info/github/chamberflag/echosign/frames">API Documentation

    It wouldn't hurt to read Adobe's Documentation

    Usage

    -

    Initializing a client

    +

    Initializing a client with an existing refresh token

    + +
    require 'echosign'
    +
    +credentials = Echosign::Credentials.new(app_id, app_secret)
    +access_token = credentials.refresh_access_token(refresh_token)
    +
    +client = Echosign::Client.new(access_token)
    +
    + +

    Initializing a client with an authorization code

    + +

    Workflow before authorizing: - redirect_uri must be set in the +EchoSign API configuration - scope will typically be something +like 'agreement_write:account agreement_send:account'

    require 'echosign'
     
    -credentials = Echosign::Refresh.new(app_id, app_secret, refresh_token)
    +credentials = Echosign::Credentials.new(app_id, app_secret)
    +redirect_to credentials.authorize_url(redirect_uri, scope)
    +
    + +

    Workflow after authorizing: “` require 'echosign'

    + +

    credentials = Echosign::Credentials.new(app_id, app_secret) token = credentials.get_token(params, redirect_uri)

    + +

    you should persist credentials.refresh_token somewhere to use in future

    + +

    client = Echosign::Client.new(token) “`

    + +

    Initializing a client with a legacy integration key

    + +
    require 'echosign'
     
    -client = Echosign::Client.new(credentials)
    +client = Echosign::Client.new(integration_key)
     

    Setting up a new agreement from a URL

    @@ -109,9 +141,9 @@

    Setting up a new agreement role: 'SIGNER', email: 'superguy@whatsit.com' } -agreement_info_params = { +agreement_info = { fileInfos: [ Echosign::Fileinfo.new(file_info_params) ], - recipients: [ Echosign::Recipient.new(recipient_params)], + recipientSetInfos: [ Echosign::Recipient.new(recipient_params)], signatureFlow: "SENDER_SIGNS_LAST", signatureType: "ESIGN", name: "Rumplestiltskin Contract" @@ -149,7 +181,7 @@

    Sending a transie

    diff --git a/doc/method_list.html b/doc/method_list.html index 2e2f843..0f5b9ae 100644 --- a/doc/method_list.html +++ b/doc/method_list.html @@ -45,6 +45,14 @@

    Method List

  • +
    + #access_token + Echosign::Credentials +
    +
  • + + +
  • #agreement_combined_pdf Echosign::Client @@ -52,7 +60,7 @@

    Method List

  • -
  • +
  • agreement_combined_pdf Echosign::Request @@ -60,7 +68,7 @@

    Method List

  • -
  • +
  • #agreement_document_file Echosign::Client @@ -68,7 +76,7 @@

    Method List

  • -
  • +
  • agreement_document_file Echosign::Request @@ -76,7 +84,7 @@

    Method List

  • -
  • +
  • #agreement_documents Echosign::Client @@ -84,7 +92,7 @@

    Method List

  • -
  • +
  • agreement_documents Echosign::Request @@ -92,7 +100,7 @@

    Method List

  • -
  • +
  • #agreement_form_data Echosign::Client @@ -100,7 +108,7 @@

    Method List

  • -
  • +
  • agreement_form_data Echosign::Request @@ -108,7 +116,7 @@

    Method List

  • -
  • +
  • #agreement_info Echosign::Client @@ -116,7 +124,7 @@

    Method List

  • -
  • +
  • agreement_info Echosign::Request @@ -124,7 +132,7 @@

    Method List

  • -
  • +
  • #agreement_signing_urls Echosign::Client @@ -132,7 +140,7 @@

    Method List

  • -
  • +
  • agreement_signing_urls Echosign::Request @@ -140,7 +148,7 @@

    Method List

  • -
  • +
  • #audit_trail_pdf Echosign::Client @@ -148,7 +156,7 @@

    Method List

  • -
  • +
  • audit_trail_pdf Echosign::Request @@ -156,6 +164,14 @@

    Method List

  • +
  • +
    + #authorize_url + Echosign::Credentials +
    +
  • + +
  • #cancel_agreement @@ -268,6 +284,22 @@

    Method List

  • +
  • +
    + #expires_at + Echosign::Credentials +
    +
  • + + +
  • +
    + #fetch + Echosign::Request::EndpointHash +
    +
  • + +
  • #get_agreements @@ -285,6 +317,14 @@

    Method List

  • +
    + get_base_uris + Echosign::Request +
    +
  • + + +
  • #get_library_document Echosign::Client @@ -292,7 +332,7 @@

    Method List

  • -
  • +
  • get_library_document Echosign::Request @@ -300,7 +340,7 @@

    Method List

  • -
  • +
  • #get_library_document_file Echosign::Client @@ -308,7 +348,7 @@

    Method List

  • -
  • +
  • get_library_document_file Echosign::Request @@ -316,7 +356,7 @@

    Method List

  • -
  • +
  • #get_library_document_files Echosign::Client @@ -324,7 +364,7 @@

    Method List

  • -
  • +
  • get_library_document_files Echosign::Request @@ -332,7 +372,7 @@

    Method List

  • -
  • +
  • #get_library_documents Echosign::Client @@ -340,7 +380,7 @@

    Method List

  • -
  • +
  • get_library_documents Echosign::Request @@ -348,7 +388,7 @@

    Method List

  • -
  • +
  • #get_mega_signs Echosign::Client @@ -356,17 +396,9 @@

    Method List

  • -
  • -
    - get_mega_signs - Echosign::Request -
    -
  • - -
  • - get_token + get_mega_signs Echosign::Request
  • @@ -374,8 +406,8 @@

    Method List

  • - get_token_from_refresh - Echosign::Request + #get_token + Echosign::Credentials
  • @@ -557,6 +589,14 @@

    Method List

  • +
    + #initialize + Echosign::Request::EndpointHash +
    +
  • + + +
  • #initialize Echosign::Reminder @@ -564,7 +604,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::Agreement @@ -572,7 +612,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::MegaSign @@ -580,7 +620,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::Credentials @@ -588,7 +628,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::Fileinfo @@ -596,7 +636,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::Recipient @@ -604,7 +644,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::PhoneInfo @@ -612,7 +652,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::WidgetStatus @@ -620,7 +660,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::UrlFileInfo @@ -628,7 +668,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::CounterSignerInfo @@ -636,7 +676,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::WidgetVaultingInfo @@ -644,7 +684,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::RequestFormField @@ -652,7 +692,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::FormFieldLocation @@ -660,7 +700,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::WidgetCompletionInfo @@ -668,7 +708,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::WidgetPersonalization @@ -676,7 +716,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::WidgetSecurityOption @@ -684,7 +724,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::RecipientSecurityOption @@ -692,7 +732,7 @@

    Method List

  • -
  • +
  • #initialize Echosign::WidgetSignerSecurityOption @@ -700,7 +740,7 @@

    Method List

  • -
  • +
  • #library_combined_document Echosign::Client @@ -708,7 +748,7 @@

    Method List

  • -
  • +
  • library_combined_document Echosign::Request @@ -716,7 +756,7 @@

    Method List

  • -
  • +
  • #library_document_audit_trail Echosign::Client @@ -724,7 +764,7 @@

    Method List

  • -
  • +
  • library_document_audit_trail Echosign::Request @@ -732,7 +772,7 @@

    Method List

  • -
  • +
  • #mega_sign_combined_pdf Echosign::Client @@ -740,7 +780,7 @@

    Method List

  • -
  • +
  • mega_sign_combined_pdf Echosign::Request @@ -748,7 +788,7 @@

    Method List

  • -
  • +
  • #mega_sign_document_file Echosign::Client @@ -756,7 +796,7 @@

    Method List

  • -
  • +
  • mega_sign_document_file Echosign::Request @@ -764,7 +804,7 @@

    Method List

  • -
  • +
  • #mega_sign_documents Echosign::Client @@ -772,7 +812,7 @@

    Method List

  • -
  • +
  • mega_sign_documents Echosign::Request @@ -780,7 +820,7 @@

    Method List

  • -
  • +
  • #mega_sign_form_data Echosign::Client @@ -788,7 +828,7 @@

    Method List

  • -
  • +
  • mega_sign_form_data Echosign::Request @@ -796,7 +836,7 @@

    Method List

  • -
  • +
  • #mega_sign_info Echosign::Client @@ -804,7 +844,7 @@

    Method List

  • -
  • +
  • mega_sign_info Echosign::Request @@ -812,7 +852,7 @@

    Method List

  • -
  • +
  • #mega_sign_signing_urls Echosign::Client @@ -820,7 +860,7 @@

    Method List

  • -
  • +
  • mega_sign_signing_urls Echosign::Request @@ -828,7 +868,7 @@

    Method List

  • -
  • +
  • #original_exception Echosign::Request::Failure @@ -836,7 +876,7 @@

    Method List

  • -
  • +
  • #personalize_widget Echosign::Client @@ -844,7 +884,7 @@

    Method List

  • -
  • +
  • personalize_widget Echosign::Request @@ -852,7 +892,23 @@

    Method List

  • +
  • +
    + #refresh_access_token + Echosign::Credentials +
    +
  • + +
  • +
    + #refresh_token + Echosign::Credentials +
    +
  • + + +
  • #require_exactly_one Echosign::Validatable @@ -860,7 +916,7 @@

    Method List

  • -
  • +
  • #require_keys Echosign::Validatable @@ -868,6 +924,14 @@

    Method List

  • +
  • +
    + #revoke_token + Echosign::Credentials +
    +
  • + +
  • #token diff --git a/doc/top-level-namespace.html b/doc/top-level-namespace.html index 5ba502f..222260b 100644 --- a/doc/top-level-namespace.html +++ b/doc/top-level-namespace.html @@ -100,7 +100,7 @@

    Defined Under Namespace