From 11b42b3b066a0174b46c59c1f09407c81ebc337b Mon Sep 17 00:00:00 2001 From: Larry Kluger Date: Tue, 26 Mar 2019 13:34:11 +0200 Subject: [PATCH 1/2] Test case for issue 22 1. Change eg002 to include Date and DateSign tabs on the documents 2. Change eg005 to test the envelope_api.list_tabs API call Results: the envelope_api.list_tabs call fails if the recipient has a Date tab. --- app/eg002_signing_via_email.py | 11 ++++++++++- app/eg005_envelope_recipients.py | 15 ++++++++++++--- app/templates/eg005_envelope_recipients.html | 3 +-- app/templates/home.html | 3 +-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/app/eg002_signing_via_email.py b/app/eg002_signing_via_email.py index 96d1bef4..2fefc974 100644 --- a/app/eg002_signing_via_email.py +++ b/app/eg002_signing_via_email.py @@ -197,10 +197,19 @@ def make_envelope(args): sign_here2 = SignHere( anchor_string = '/sn1/', anchor_units = 'pixels', anchor_y_offset = '10', anchor_x_offset = '20') + date1 = Date( + anchor_string = '**signature_1**', anchor_units = 'pixels', + anchor_y_offset = '10', anchor_x_offset = '100', + width = 75, tab_label = 'Date tab', name = 'Date tab' ) + dateSigned1 = DateSigned( + anchor_string = '**signature_1**', anchor_units = 'pixels', + anchor_y_offset = '10', anchor_x_offset = '220', + tab_label = 'Date signed tab' ) # Add the tabs model (including the sign_here tabs) to the signer # The Tabs object wants arrays of the different field/tab types - signer1.tabs = Tabs(sign_here_tabs=[sign_here1, sign_here2]) + signer1.tabs = Tabs(sign_here_tabs=[sign_here1, sign_here2], + date_tabs=[date1], date_signed_tabs=[dateSigned1]) # Add the recipients to the envelope object recipients = Recipients(signers=[signer1], carbon_copies=[cc1]) diff --git a/app/eg005_envelope_recipients.py b/app/eg005_envelope_recipients.py index 794c8742..4537f44b 100644 --- a/app/eg005_envelope_recipients.py +++ b/app/eg005_envelope_recipients.py @@ -1,4 +1,8 @@ -"""005: List an envelope's recipients and status""" +"""005: List an envelope's recipients and status + +Also, for issue 22, lists tabs for the signer recipient. +See https://github.com/docusign/docusign-python-client/issues/22 +""" from flask import render_template, url_for, redirect, session, flash, request from os import path @@ -54,7 +58,7 @@ def create_controller(): return render_template("example_done.html", title="Envelope recipients results", h1="List the envelope's recipients and their status", - message="Results from the EnvelopesRecipients::list method:", + message="Results from the EnvelopeRecipientTabs::list method. API method: envelope_api.list_tabs", json=json.dumps(json.dumps(results.to_dict())) ) elif not token_ok: @@ -90,7 +94,12 @@ def worker(args): envelope_api = EnvelopesApi(api_client) results = envelope_api.list_recipients(args['account_id'], args['envelope_id']) - return results + recipientId = results.signers[0].recipient_id + # Call the EnvelopeRecipientTabs: list method + envelope_api = EnvelopesApi(api_client) + results2 = envelope_api.list_tabs(args['account_id'], args['envelope_id'], recipientId) + + return results2 # ***DS.snippet.0.end diff --git a/app/templates/eg005_envelope_recipients.html b/app/templates/eg005_envelope_recipients.html index 5782e9e6..2ff59943 100644 --- a/app/templates/eg005_envelope_recipients.html +++ b/app/templates/eg005_envelope_recipients.html @@ -1,7 +1,6 @@ {% extends "base.html" %} {% block content %} -

5. List an envelope's recipients and their status

-

List the envelope's recipients, including their current status.

+

5. TEST for Issue 22: EnvelopeRecipientTabs::list

{% if show_doc %}

Documentation about this example.

diff --git a/app/templates/home.html b/app/templates/home.html index b28c3a4a..f69e751e 100644 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -18,8 +18,7 @@

Welcome!

Welcome

-

This launcher both demonstrates use of the OAuth Authorization Code Grant flow and includes multiple - usage examples for the DocuSign eSignature REST API.

+

Test for Issue 22: EnvelopeRecipientTabs::list

{% if show_doc %}

Documentation on using OAuth Authorization Code Grant from a From d21c9e873b115fe8c0a055d68c26dfb59c6bb0c1 Mon Sep 17 00:00:00 2001 From: Larry Kluger Date: Tue, 26 Mar 2019 13:53:53 +0200 Subject: [PATCH 2/2] This ver works with v2 --- app/eg001_embedded_signing.py | 2 +- app/eg002_signing_via_email.py | 2 +- app/eg003_list_envelopes.py | 2 +- app/eg004_envelope_info.py | 2 +- app/eg005_envelope_recipients.py | 2 +- app/eg006_envelope_docs.py | 2 +- app/eg007_envelope_get_doc.py | 2 +- app/eg008_create_template.py | 2 +- app/eg009_use_template.py | 2 +- app/eg011_embedded_sending.py | 2 +- app/eg012_embedded_console.py | 2 +- app/eg013_add_doc_to_template.py | 2 +- app/eg014_collect_payment.py | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/eg001_embedded_signing.py b/app/eg001_embedded_signing.py index bfabb5bd..d9e4f008 100644 --- a/app/eg001_embedded_signing.py +++ b/app/eg001_embedded_signing.py @@ -7,7 +7,7 @@ import base64 import re from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg001" # reference (and url) for this example signer_client_id = 1000 # Used to indicate that the signer will use an embedded diff --git a/app/eg002_signing_via_email.py b/app/eg002_signing_via_email.py index 2fefc974..22348ed5 100644 --- a/app/eg002_signing_via_email.py +++ b/app/eg002_signing_via_email.py @@ -7,7 +7,7 @@ import re import json from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg002" # reference (and url) for this example demo_docs_path = path.abspath(path.join(path.dirname(path.realpath(__file__)), 'static/demo_documents')) diff --git a/app/eg003_list_envelopes.py b/app/eg003_list_envelopes.py index f7085159..f2246054 100644 --- a/app/eg003_list_envelopes.py +++ b/app/eg003_list_envelopes.py @@ -6,7 +6,7 @@ from app import app, ds_config, views from datetime import datetime, timedelta from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg003" # reference (and url) for this example diff --git a/app/eg004_envelope_info.py b/app/eg004_envelope_info.py index 13645699..504cbe39 100644 --- a/app/eg004_envelope_info.py +++ b/app/eg004_envelope_info.py @@ -5,7 +5,7 @@ import json from app import app, ds_config, views from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg004" # reference (and url) for this example diff --git a/app/eg005_envelope_recipients.py b/app/eg005_envelope_recipients.py index 4537f44b..a760d676 100644 --- a/app/eg005_envelope_recipients.py +++ b/app/eg005_envelope_recipients.py @@ -9,7 +9,7 @@ import json from app import ds_config, views from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg005" # reference (and url) for this example diff --git a/app/eg006_envelope_docs.py b/app/eg006_envelope_docs.py index 95151ec6..8faf3b96 100644 --- a/app/eg006_envelope_docs.py +++ b/app/eg006_envelope_docs.py @@ -5,7 +5,7 @@ import json from app import app, ds_config, views from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg006" # reference (and url) for this example diff --git a/app/eg007_envelope_get_doc.py b/app/eg007_envelope_get_doc.py index f6901b5d..904a94a1 100644 --- a/app/eg007_envelope_get_doc.py +++ b/app/eg007_envelope_get_doc.py @@ -7,7 +7,7 @@ import io from app import app, ds_config, views from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg007" # reference (and url) for this example diff --git a/app/eg008_create_template.py b/app/eg008_create_template.py index a8e37ba5..2f517a83 100644 --- a/app/eg008_create_template.py +++ b/app/eg008_create_template.py @@ -7,7 +7,7 @@ import re import json from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg008" # reference (and url) for this example demo_docs_path = path.abspath(path.join(path.dirname(path.realpath(__file__)), 'static/demo_documents')) diff --git a/app/eg009_use_template.py b/app/eg009_use_template.py index d3032e72..58f6feec 100644 --- a/app/eg009_use_template.py +++ b/app/eg009_use_template.py @@ -7,7 +7,7 @@ import base64 import re from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg009" # reference (and url) for this example diff --git a/app/eg011_embedded_sending.py b/app/eg011_embedded_sending.py index b3c7bf0e..6ac80f87 100644 --- a/app/eg011_embedded_sending.py +++ b/app/eg011_embedded_sending.py @@ -6,7 +6,7 @@ import re from app import app, ds_config, views, eg002_signing_via_email from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg011" # reference (and url) for this example diff --git a/app/eg012_embedded_console.py b/app/eg012_embedded_console.py index b582c916..65f56eae 100644 --- a/app/eg012_embedded_console.py +++ b/app/eg012_embedded_console.py @@ -6,7 +6,7 @@ import re from app import ds_config, views from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg012" # reference (and url) for this example diff --git a/app/eg013_add_doc_to_template.py b/app/eg013_add_doc_to_template.py index 415ca031..45331b41 100644 --- a/app/eg013_add_doc_to_template.py +++ b/app/eg013_add_doc_to_template.py @@ -7,7 +7,7 @@ import base64 import re from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg013" # reference (and url) for this example signer_client_id = 1000 # The id of the signer within this application. diff --git a/app/eg014_collect_payment.py b/app/eg014_collect_payment.py index e385e4bb..9a5e996d 100644 --- a/app/eg014_collect_payment.py +++ b/app/eg014_collect_payment.py @@ -7,7 +7,7 @@ import re import json from docusign_esign import * -from docusign_esign.rest import ApiException +from docusign_esign.client.api_exception import ApiException eg = "eg014" # reference (and url) for this example demo_docs_path = path.abspath(path.join(path.dirname(path.realpath(__file__)), 'static/demo_documents'))