Skip to content

Commit

Permalink
Various updates
Browse files Browse the repository at this point in the history
  • Loading branch information
InbarGazit committed Jan 7, 2025
1 parent 350c8a4 commit 1d60b85
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ For a list of code examples that use the Web Forms API, see the [How-to guides o
### Prerequisites
**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.

1. A free [Docusign developer account](https://www.docusign.com/developers/sandbox); create one if you don't already have one.
1. A free [Docusign developer account](https://go.docusign.com/o/sandbox/); create one if you don't already have one.
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.

This [video](https://www.youtube.com/watch?v=eiRI4fe5HgM) demonstrates how to obtain an integration key.
Expand Down
6 changes: 4 additions & 2 deletions app/monitor/examples/eg001_get_monitoring_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from docusign_monitor import DataSetApi
from flask import session
from datetime import datetime, timedelta, timezone

from app.monitor.utils import create_monitor_api_client

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

cursor_value = ''
limit = 100
cursor_value = cursor_date.strftime('%Y-%m-%dT00:00:00Z')
limit = 2000
function_results = []
complete = False

Expand Down
9 changes: 8 additions & 1 deletion app/quick_acg/quick_acg_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ def ds_callback():

# Save the redirect eg if present
redirect_url = session.pop("eg", None)
resp = DSClient.get_token("code_grant")
try:
resp = DSClient.get_token("code_grant")
except Exception as err:
if session.get("pkce_failed", False):
raise err

session["pkce_failed"] = True
return redirect(url_for("ds.ds_login"))

# app.logger.info("Authenticated with DocuSign.")
session["ds_access_token"] = resp["access_token"]
Expand Down
1 change: 1 addition & 0 deletions app/quick_acg/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os

quick_acg_app.config["QUICK_ACG"] = True
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'

if os.environ.get("DEBUG", False) == "True":
quick_acg_app.config["DEBUG"] = True
Expand Down
2 changes: 1 addition & 1 deletion app/templates/webforms/eg001_web_form_embed.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<body>
<div id="app">
<div id="webform-customer-app-area">
<h1 id="webforms-heading">Embedded web form example</h1>
<h5 id="webforms-heading">{{ webforms_heading }}</h5>
<div id="docusign" class="webform-iframe-container">
<p>Web Form will render here</p>
</div>
Expand Down
7 changes: 6 additions & 1 deletion app/webforms/views/eg001_create_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ def create_web_form_instance():
except Exception as error:
return process_error(error)

example = get_example_by_number(session["manifest"], example_number, api)
additional_page_data = next((p for p in example["AdditionalPage"] if p["Name"] == "webforms_heading"),
None)

return render_template(
"webforms/eg001_web_form_embed.html",
form_url=results.form_url,
instance_token=results.instance_token,
integration_key=DS_CONFIG["ds_client_id"]
integration_key=DS_CONFIG["ds_client_id"],
webforms_heading=additional_page_data["ResultsPageText"]
)


Expand Down

0 comments on commit 1d60b85

Please sign in to comment.