Class: Echochamber::Client
- Inherits:
-
Object
- Object
- Echochamber::Client
- Defined in:
- lib/echochamber/client.rb,
lib/echochamber/widget/client.rb,
lib/echochamber/agreement/client.rb,
lib/echochamber/library_documents/client.rb
Instance Attribute Summary (collapse)
-
- (Object) token
readonly
Returns the value of attribute token.
Instance Method Summary (collapse)
-
- (String) agreement_combined_pdf(agreement_id, file_path = nil, versionId = nil, participantEmail = nil, attachSupportingDocuments = true, auditReport = false)
Gets a single combined PDF document for the documents associated with an agreement.
-
- (String) agreement_document_file(agreement_id, document_id, file_path = nil)
Retrieve a document file from an agreement.
-
- (Array) agreement_documents(agreement_id, recipient_email, format, version_id = nil)
All documents relating to an agreement.
-
- (String) agreement_form_data(agreement_id, file_path = nil)
Retrieves library document audit trail file.
-
- (Hash) agreement_info(agreement_id)
Gets detailed info on an agreement.
-
- (Hash) agreement_signing_urls(agreement_id)
Retrieves the URL for the eSign page for the current signer(s) of an agreement.
-
- (String) audit_trail_pdf(agreement_id, file_path = nil)
Retrieve a PDF audit file for an agreement.
-
- (String) cancel_agreement(agreement_id, notify_signer = false, comment = nil)
Cancel agreement.
-
- (String) create_agreement(agreement)
Creates an agreement.
-
- (String) create_reminder(reminder)
Creates a reminder.
-
- (String) create_transient_document(file_name, mime_type, file_handle)
Creates a transient document for later referral.
-
- (String) create_user(user)
Creates a user for the current application.
-
- (Hash) create_widget(widget)
Creates a widget and returns the Javascript snippet and URL to access the widget and widgetID in response to the client.
-
- (String) get_agreements
Gets list of agreements.
-
- (Hash) get_library_document(library_document_id)
Retrieves library document metadata.
-
- (String) get_library_document_file(library_document_id, file_id, file_path = nil)
Retrieves library document file data.
-
- (Hash) get_library_document_files(library_document_id)
Retrieves library document files metadata.
-
- (Hash) get_library_documents(user_id = nil, user_email = nil)
Retrieves library documents metadata for a user.
-
- (Hash) get_user(user_id)
Gets all the users in an account that the caller has permissions to access.
-
- (Hash) get_users(user_email)
Gets all the users in an account that the caller has permissions to access.
-
- (Hash) get_widget(widget_id)
Retrieves the details of a widget.
-
- (String) get_widget_audit_trail(widget_id, file_path = nil)
Retrieves the audit trail of a widget identified by widgetId.
-
- (String) get_widget_combined_pdf(widget_id, file_path = nil)
Gets a single combined PDF document for the documents associated with a widget.
-
- (String) get_widget_document_file(widget_id, document_id, file_path = nil)
Retrieves the file stream of a document of a widget.
-
- (Hash) get_widget_documents(widget_id, version_id = nil, participant_email = nil)
Retrieves the IDs of the documents associated with widget.
-
- (String) get_widget_form_data(widget_id, file_path = nil)
Retrieves data entered by the user into interactive form fields at the time they signed the widget.
-
- (Hash) get_widgets(user_id = nil, user_email = nil)
Retrieves widgets for a user.
-
- (Echochamber::Client) initialize(credentials)
constructor
Initializes the Client object.
-
- (String) library_combined_document(library_document_id, file_path = nil, auditReport = false)
Retrieves library combined document file.
-
- (String) library_document_audit_trail(library_document_id, file_path = nil)
Retrieves library document audit trail file.
-
- (Hash) personalize_widget(widget_id, personalization)
Personalize the widget to a signable document for a specific known user.
-
- (Hash) update_widget_status(widget_id, status)
Enables or Disables a widget.
Constructor Details
- (Echochamber::Client) initialize(credentials)
Initializes the Client object
15 16 17 |
# File 'lib/echochamber/client.rb', line 15 def initialize(credentials) @token = Echochamber::Request.get_token(credentials) end |
Instance Attribute Details
- (Object) token (readonly)
Returns the value of attribute token
10 11 12 |
# File 'lib/echochamber/client.rb', line 10 def token @token end |
Instance Method Details
- (String) agreement_combined_pdf(agreement_id, file_path = nil, versionId = nil, participantEmail = nil, attachSupportingDocuments = true, auditReport = false)
Gets a single combined PDF document for the documents associated with an agreement.
92 93 94 95 96 97 98 99 100 |
# File 'lib/echochamber/agreement/client.rb', line 92 def agreement_combined_pdf(agreement_id, file_path=nil, versionId=nil, participantEmail=nil, attachSupportingDocuments=true, auditReport=false) response = Echochamber::Request.agreement_combined_pdf(token, agreement_id, versionId, participantEmail, attachSupportingDocuments, auditReport) unless file_path.nil? file = File.new(file_path, 'wb') file.write(response) file.close end response end |
- (String) agreement_document_file(agreement_id, document_id, file_path = nil)
Retrieve a document file from an agreement
65 66 67 68 69 70 71 72 73 |
# File 'lib/echochamber/agreement/client.rb', line 65 def agreement_document_file(agreement_id, document_id, file_path=nil) response = Echochamber::Request.agreement_document_file(token, agreement_id, document_id) unless file_path.nil? file = File.new(file_path, 'wb') file.write(response) file.close end response end |
- (Array) agreement_documents(agreement_id, recipient_email, format, version_id = nil)
All documents relating to an agreement
55 56 57 |
# File 'lib/echochamber/agreement/client.rb', line 55 def agreement_documents(agreement_id, recipient_email, format, version_id=nil) result = Echochamber::Request.agreement_documents(token, agreement_id, recipient_email, format, version_id) end |
- (String) agreement_form_data(agreement_id, file_path = nil)
Retrieves library document audit trail file
107 108 109 110 111 112 113 114 115 |
# File 'lib/echochamber/agreement/client.rb', line 107 def agreement_form_data(agreement_id, file_path=nil) response = Echochamber::Request.agreement_form_data(token, agreement_id) unless file_path.nil? file = File.new(file_path, 'wb') file.write(response) file.close end response end |
- (Hash) agreement_info(agreement_id)
Gets detailed info on an agreement
27 28 29 |
# File 'lib/echochamber/agreement/client.rb', line 27 def agreement_info(agreement_id) Echochamber::Request.agreement_info(token, agreement_id) end |
- (Hash) agreement_signing_urls(agreement_id)
Retrieves the URL for the eSign page for the current signer(s) of an agreement
79 80 81 |
# File 'lib/echochamber/agreement/client.rb', line 79 def agreement_signing_urls(agreement_id) response = Echochamber::Request.agreement_signing_urls(token, agreement_id) end |
- (String) audit_trail_pdf(agreement_id, file_path = nil)
Retrieve a PDF audit file for an agreement
52 53 54 55 56 57 58 59 60 |
# File 'lib/echochamber/client.rb', line 52 def audit_trail_pdf(agreement_id, file_path=nil) response = Echochamber::Request.audit_trail_pdf(token, agreement_id) unless file_path.nil? file = File.new(file_path, 'wb') file.write(response) file.close end response end |
- (String) cancel_agreement(agreement_id, notify_signer = false, comment = nil)
Cancel agreement
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/echochamber/agreement/client.rb', line 37 def cancel_agreement(agreement_id, notify_signer=false, comment=nil) request_body = { "value" => "CANCEL", "notifySigner" => notify_signer } request_body.merge!(comment: comment) unless comment.nil? agreement_status_response = Echochamber::Request.update_agreement_status(token, agreement_id, request_body) agreement_status_response.fetch('result') end |
- (String) create_agreement(agreement)
Creates an agreement
9 10 11 12 |
# File 'lib/echochamber/agreement/client.rb', line 9 def create_agreement(agreement) agreement_response = Echochamber::Request.create_agreement(agreement, token, agreement.user_id, agreement.user_email) agreement_response.fetch("agreementId") end |
- (String) create_reminder(reminder)
Creates a reminder
32 33 34 |
# File 'lib/echochamber/client.rb', line 32 def create_reminder(reminder) reminder_response = Echochamber::Request.create_reminder(token, reminder) end |
- (String) create_transient_document(file_name, mime_type, file_handle)
Creates a transient document for later referral
42 43 44 45 |
# File 'lib/echochamber/client.rb', line 42 def create_transient_document(file_name, mime_type, file_handle) transient_document_response = Echochamber::Request.create_transient_document(token, file_name, file_handle, mime_type) transient_document_response.fetch("transientDocumentId") end |
- (String) create_user(user)
Creates a user for the current application
23 24 25 26 |
# File 'lib/echochamber/client.rb', line 23 def create_user(user) user_response = Echochamber::Request.create_user(user, token) user_response.fetch("userId") end |
- (Hash) create_widget(widget)
Creates a widget and returns the Javascript snippet and URL to access the widget and widgetID in response to the client
9 10 11 |
# File 'lib/echochamber/widget/client.rb', line 9 def () Echochamber::Request.(token, ) end |
- (String) get_agreements
Gets list of agreements
18 19 20 21 |
# File 'lib/echochamber/agreement/client.rb', line 18 def get_agreements get_agreements_response = Echochamber::Request.get_agreements(token) get_agreements_response.fetch("userAgreementList") end |
- (Hash) get_library_document(library_document_id)
Retrieves library document metadata
18 19 20 |
# File 'lib/echochamber/library_documents/client.rb', line 18 def get_library_document(library_document_id) Echochamber::Request.get_library_document(token, library_document_id) end |
- (String) get_library_document_file(library_document_id, file_id, file_path = nil)
Retrieves library document file data
36 37 38 39 40 41 42 43 44 |
# File 'lib/echochamber/library_documents/client.rb', line 36 def get_library_document_file(library_document_id, file_id, file_path=nil) response = Echochamber::Request.get_library_document_file(token, library_document_id, file_id) unless file_path.nil? file = File.new(file_path, 'wb') file.write(response) file.close end response end |
- (Hash) get_library_document_files(library_document_id)
Retrieves library document files metadata
26 27 28 |
# File 'lib/echochamber/library_documents/client.rb', line 26 def get_library_document_files(library_document_id) Echochamber::Request.get_library_document_files(token, library_document_id) end |
- (Hash) get_library_documents(user_id = nil, user_email = nil)
Retrieves library documents metadata for a user.
10 11 12 |
# File 'lib/echochamber/library_documents/client.rb', line 10 def get_library_documents(user_id=nil, user_email=nil) Echochamber::Request.get_library_documents(token, user_id, user_email) end |
- (Hash) get_user(user_id)
Gets all the users in an account that the caller has permissions to access.
75 76 77 |
# File 'lib/echochamber/client.rb', line 75 def get_user(user_id) Echochamber::Request.get_user(token, user_id) end |
- (Hash) get_users(user_email)
Gets all the users in an account that the caller has permissions to access.
67 68 69 |
# File 'lib/echochamber/client.rb', line 67 def get_users(user_email) Echochamber::Request.get_users(token, user_email) end |
- (Hash) get_widget(widget_id)
Retrieves the details of a widget
44 45 46 |
# File 'lib/echochamber/widget/client.rb', line 44 def () Echochamber::Request.(token, ) end |
- (String) get_widget_audit_trail(widget_id, file_path = nil)
SEEMINGLY NOT YET IMPLEMENTED SERVER-SIDE
Retrieves the audit trail of a widget identified by widgetId
80 81 82 83 84 85 86 87 88 |
# File 'lib/echochamber/widget/client.rb', line 80 def (, file_path=nil) response = Echochamber::Request.(token, ) unless file_path.nil? file = File.new(file_path, 'wb') file.write(response) file.close end response end |
- (String) get_widget_combined_pdf(widget_id, file_path = nil)
SEEMINGLY NOT YET IMPLEMENTED SERVER-SIDE
Gets a single combined PDF document for the documents associated with a widget.
96 97 98 99 100 101 102 103 104 |
# File 'lib/echochamber/widget/client.rb', line 96 def (, file_path=nil) response = Echochamber::Request.(token, ) unless file_path.nil? file = File.new(file_path, 'wb') file.write(response) file.close end response end |
- (String) get_widget_document_file(widget_id, document_id, file_path = nil)
Retrieves the file stream of a document of a widget
64 65 66 67 68 69 70 71 72 |
# File 'lib/echochamber/widget/client.rb', line 64 def (, document_id, file_path=nil) response = Echochamber::Request.(token, , document_id) unless file_path.nil? file = File.new(file_path, 'wb') file.write(response) file.close end response end |
- (Hash) get_widget_documents(widget_id, version_id = nil, participant_email = nil)
Retrieves the IDs of the documents associated with widget.
54 55 56 |
# File 'lib/echochamber/widget/client.rb', line 54 def (, version_id=nil, participant_email=nil) Echochamber::Request.(token, , version_id, participant_email) end |
- (String) get_widget_form_data(widget_id, file_path = nil)
SEEMINGLY NOT YET IMPLEMENTED SERVER-SIDE
Retrieves data entered by the user into interactive form fields at the time they signed the widget
112 113 114 115 116 117 118 119 120 |
# File 'lib/echochamber/widget/client.rb', line 112 def (, file_path=nil) response = Echochamber::Request.(token, ) unless file_path.nil? file = File.new(file_path, 'wb') file.write(response) file.close end response end |
- (Hash) get_widgets(user_id = nil, user_email = nil)
Retrieves widgets for a user
36 37 38 |
# File 'lib/echochamber/widget/client.rb', line 36 def (user_id=nil, user_email=nil) Echochamber::Request.(token, user_id, user_email) end |
- (String) library_combined_document(library_document_id, file_path = nil, auditReport = false)
Retrieves library combined document file
67 68 69 70 71 72 73 74 75 |
# File 'lib/echochamber/library_documents/client.rb', line 67 def library_combined_document(library_document_id, file_path=nil, auditReport=false) response = Echochamber::Request.library_combined_document(token, library_document_id, auditReport) unless file_path.nil? file = File.new(file_path, 'wb') file.write(response) file.close end response end |
- (String) library_document_audit_trail(library_document_id, file_path = nil)
Retrieves library document audit trail file
51 52 53 54 55 56 57 58 59 |
# File 'lib/echochamber/library_documents/client.rb', line 51 def library_document_audit_trail(library_document_id, file_path=nil) response = Echochamber::Request.library_document_audit_trail(token, library_document_id) unless file_path.nil? file = File.new(file_path, 'wb') file.write(response) file.close end response end |
- (Hash) personalize_widget(widget_id, personalization)
Personalize the widget to a signable document for a specific known user
18 19 20 |
# File 'lib/echochamber/widget/client.rb', line 18 def (, personalization) Echochamber::Request.(token, , personalization) end |
- (Hash) update_widget_status(widget_id, status)
Enables or Disables a widget
27 28 29 |
# File 'lib/echochamber/widget/client.rb', line 27 def (, status) Echochamber::Request.(token, , status) end |