Skip to content

Commit 1d60b85

Browse files
committed
Various updates
1 parent 350c8a4 commit 1d60b85

File tree

6 files changed

+21
-6
lines changed

6 files changed

+21
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ For a list of code examples that use the Web Forms API, see the [How-to guides o
7272
### Prerequisites
7373
**Note:** If you downloaded this code using [Quickstart](https://developers.docusign.com/docs/esign-rest-api/quickstart/) from the Docusign Developer Center, skip items 1 and 2 as they were automatically performed for you.
7474

75-
1. A free [Docusign developer account](https://www.docusign.com/developers/sandbox); create one if you don't already have one.
75+
1. A free [Docusign developer account](https://go.docusign.com/o/sandbox/); create one if you don't already have one.
7676
1. A Docusign app and integration key that is configured to use either [Authorization Code Grant](https://developers.docusign.com/platform/auth/authcode/) or [JWT Grant](https://developers.docusign.com/platform/auth/jwt/) authentication.
7777

7878
This [video](https://www.youtube.com/watch?v=eiRI4fe5HgM) demonstrates how to obtain an integration key.

app/monitor/examples/eg001_get_monitoring_data.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from docusign_monitor import DataSetApi
22
from flask import session
3+
from datetime import datetime, timedelta, timezone
34

45
from app.monitor.utils import create_monitor_api_client
56

@@ -25,10 +26,11 @@ def worker(args):
2526
)
2627
#ds-snippet-end:Monitor1Step2
2728
#ds-snippet-start:Monitor1Step3
29+
cursor_date = datetime.now(timezone.utc).replace(year=datetime.now(timezone.utc).year - 1)
2830
dataset_api = DataSetApi(api_client=api_client)
2931

30-
cursor_value = ''
31-
limit = 100
32+
cursor_value = cursor_date.strftime('%Y-%m-%dT00:00:00Z')
33+
limit = 2000
3234
function_results = []
3335
complete = False
3436

app/quick_acg/quick_acg_app/views.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,14 @@ def ds_callback():
3434

3535
# Save the redirect eg if present
3636
redirect_url = session.pop("eg", None)
37-
resp = DSClient.get_token("code_grant")
37+
try:
38+
resp = DSClient.get_token("code_grant")
39+
except Exception as err:
40+
if session.get("pkce_failed", False):
41+
raise err
42+
43+
session["pkce_failed"] = True
44+
return redirect(url_for("ds.ds_login"))
3845

3946
# app.logger.info("Authenticated with DocuSign.")
4047
session["ds_access_token"] = resp["access_token"]

app/quick_acg/run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55

66
quick_acg_app.config["QUICK_ACG"] = True
7+
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
78

89
if os.environ.get("DEBUG", False) == "True":
910
quick_acg_app.config["DEBUG"] = True

app/templates/webforms/eg001_web_form_embed.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<body>
1313
<div id="app">
1414
<div id="webform-customer-app-area">
15-
<h1 id="webforms-heading">Embedded web form example</h1>
15+
<h5 id="webforms-heading">{{ webforms_heading }}</h5>
1616
<div id="docusign" class="webform-iframe-container">
1717
<p>Web Form will render here</p>
1818
</div>

app/webforms/views/eg001_create_instance.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,16 @@ def create_web_form_instance():
5555
except Exception as error:
5656
return process_error(error)
5757

58+
example = get_example_by_number(session["manifest"], example_number, api)
59+
additional_page_data = next((p for p in example["AdditionalPage"] if p["Name"] == "webforms_heading"),
60+
None)
61+
5862
return render_template(
5963
"webforms/eg001_web_form_embed.html",
6064
form_url=results.form_url,
6165
instance_token=results.instance_token,
62-
integration_key=DS_CONFIG["ds_client_id"]
66+
integration_key=DS_CONFIG["ds_client_id"],
67+
webforms_heading=additional_page_data["ResultsPageText"]
6368
)
6469

6570

0 commit comments

Comments
 (0)