Skip to content

Commit d714bb5

Browse files
committed
codeDepot markers
1 parent 6897222 commit d714bb5

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

app/services/webforms/eg001_create_instance_service.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,20 @@ def create_web_form_template
2828
end
2929

3030
def list_web_forms
31+
#ds-snippet-start:WebForms1Step2
3132
configuration = DocuSign_WebForms::Configuration.new
32-
3333
api_client = DocuSign_WebForms::ApiClient.new(configuration)
3434
api_client.set_default_header('Authorization', "Bearer #{args[:access_token]}")
35+
#ds-snippet-end:WebForms1Step2
3536

37+
#ds-snippet-start:WebForms1Step3
3638
webforms_api = DocuSign_WebForms::FormManagementApi.new(api_client)
3739

3840
options = DocuSign_WebForms::ListFormsOptions.new
3941
options.search = args[:form_name]
4042

4143
webforms_api.list_forms(args[:account_id], options)
44+
#ds-snippet-end:WebForms1Step3
4245
end
4346

4447
def create_web_form_instance(form_id)
@@ -47,8 +50,7 @@ def create_web_form_instance(form_id)
4750
api_client = DocuSign_WebForms::ApiClient.new(configuration)
4851
api_client.set_default_header('Authorization', "Bearer #{args[:access_token]}")
4952

50-
webforms_api = DocuSign_WebForms::FormInstanceManagementApi.new(api_client)
51-
53+
#ds-snippet-start:WebForms1Step4
5254
web_form_values = {
5355
'PhoneNumber' => '555-555-5555',
5456
'Yes' => ['Yes'],
@@ -60,7 +62,12 @@ def create_web_form_instance(form_id)
6062
'formValues' => web_form_values,
6163
'expirationOffset' => '3600'
6264
})
65+
#ds-snippet-end:WebForms1Step4
66+
67+
#ds-snippet-start:WebForms1Step5
68+
webforms_api = DocuSign_WebForms::FormInstanceManagementApi.new(api_client)
6369
webforms_api.create_instance(args[:account_id], form_id, web_form_req_object)
70+
#ds-snippet-end:WebForms1Step5
6471
end
6572

6673
private

app/views/webforms/weg001_create_instance/web_form_embed.html.erb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919
<p><a href="/">Continue</a></p>
2020

21+
<!--
22+
#ds-snippet-start:WebForms1Step6
23+
-->
24+
2125
<script src="https://js.docusign.com/bundle.js"></script>
2226
<script>
2327
async function loadWebform() {
@@ -87,4 +91,8 @@
8791
webFormWidget.mount("#docusign");
8892
}
8993
loadWebform();
90-
</script>
94+
</script>
95+
96+
<!--
97+
#ds-snippet-end:WebForms1Step6
98+
-->

0 commit comments

Comments
 (0)