forked from docusign/code-examples-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eg015_service.rb
33 lines (27 loc) · 884 Bytes
/
eg015_service.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# frozen_string_literal: true
class ESign::Eg015Service
include ApiCreator
attr_reader :args, :envelope_id
def initialize(envelope_id, session)
@args = {
access_token: session['ds_access_token'],
base_path: session['ds_base_path'],
account_id: session['ds_account_id']
}
@envelope_id = envelope_id
end
def call
results = worker
end
private
# ***DS.snippet.0.start
def worker
# Step 3. Call the eSignature REST API
# The Envelopes::getEnvelopeFormData method has many options
# See https://developers.docusign.com/esign-rest-api/reference/Envelopes/EnvelopeFormData/get
# The get form data call requires an account ID and an envelope ID
# Exceptions will be caught by the calling function
results = create_envelope_api(args).get_form_data args[:account_id], envelope_id
end
# ***DS.snippet.0.end
end