Skip to content

Commit fef8ffb

Browse files
review fixes
1 parent 3cfd8e0 commit fef8ffb

7 files changed

Lines changed: 45 additions & 47 deletions

File tree

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,24 @@ This example exports all the available data from a specific room in your DocuSig
148148
This example adds a standard real estate related form to a specific room in your DocuSign Rooms account.
149149
1. **How to search for rooms with filters.**
150150
[Source.](./app/rooms/examples/eg005_get_rooms_with_filters/controller.py)
151+
This example demonstrates how to return rooms that have had their field data,
152+
updated within the time period between <b>Start date</b> and <b>End date</b>.
151153
1. **Create an external form fillable session.**
152154
[Source.](./app/rooms/examples/eg006_create_external_form_fill_session/controller.py)
153-
155+
This example demonstrates how to create an
156+
<a href="https://developers.docusign.com/rooms-api/guides/forms" target="_blank">external form fill session</a>
157+
using the Rooms API:</br>
158+
the result of this code example is the URL for the form fill session, which you can embed
159+
in your integration or send to the user.
160+
1. **Create a form group**
161+
[Source.](./app/rooms/examples/eg007_create_form_group/controller.py)
162+
This example demonstrates creating a DocuSign Form Group.
163+
1. **Grant office access to a form group**
164+
[Source.](./app/rooms/examples/eg008_grant_office_access_to_form_group/controller.py)
165+
This example demonstrates how to grant Office access to a Form Group.
166+
1. **Assign a form to a form group**
167+
[Source.](./app/rooms/examples/eg009_assign_form_to_form_group/controller.py)
168+
This example demonstrates how to assign form to a form group.
154169

155170
## Included OAuth grant types:
156171

app/rooms/examples/eg007_create_form_group/controller.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1+
from docusign_rooms import FormGroupForCreate, FormGroupsApi
12
from flask import session, request
23

34
from app.rooms import create_rooms_api_client
4-
from docusign_rooms import FormGroupForCreate, FormGroupsApi
55

66

77
class Eg007Controller:
88
@staticmethod
99
def get_args():
1010
"""Get required session and request arguments"""
1111
return {
12-
"account_id": session["ds_account_id"],
13-
# Represents your {ACCOUNT_ID}
14-
"access_token": session["ds_access_token"],
15-
# Represents your {ACCESS_TOKEN}
12+
"account_id": session["ds_account_id"], # Represents your {ACCOUNT_ID}
13+
"access_token": session["ds_access_token"], # Represents your {ACCESS_TOKEN}
1614
"form_group_name": request.form.get("form_group_name"),
1715
}
1816

app/rooms/examples/eg008_grant_office_access_to_form_group/controller.py

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
from typing import List
2-
31
from docusign_rooms import (
42
FormGroupsApi,
5-
FormGroupSummary,
63
FormGroupSummaryList,
7-
OfficeSummary,
84
OfficesApi,
95
OfficeSummaryList,
106
)
@@ -15,19 +11,17 @@
1511

1612
class Eg008Controller:
1713
@staticmethod
18-
def get_args() -> dict:
14+
def get_args():
1915
"""Get required session and request arguments"""
2016
return {
21-
"account_id": session["ds_account_id"],
22-
# Represents your {ACCOUNT_ID}
23-
"access_token": session["ds_access_token"],
24-
# Represents your {ACCESS_TOKEN}
17+
"account_id": session["ds_account_id"], # Represents your {ACCOUNT_ID}
18+
"access_token": session["ds_access_token"], # Represents your {ACCESS_TOKEN}
2519
"form_group_id": request.form.get("form_group_id"),
2620
"office_id": request.form.get("office_id")
2721
}
2822

2923
@staticmethod
30-
def get_form_groups(args) -> List[FormGroupSummary]:
24+
def get_form_groups(args):
3125
"""
3226
1. Create an API Client with headers
3327
2. GET Form Groups via FormGroupsAPI
@@ -38,13 +32,13 @@ def get_form_groups(args) -> List[FormGroupSummary]:
3832

3933
# Step 2. GET Form Groups via FormGroupsAPI
4034
form_groups_api = FormGroupsApi(api_client)
41-
responses = form_groups_api.get_form_groups(
35+
response = form_groups_api.get_form_groups(
4236
account_id=args["account_id"]) # type: FormGroupSummaryList
4337

44-
return responses.form_groups
38+
return response.form_groups
4539

4640
@staticmethod
47-
def get_offices(args) -> List[OfficeSummary]:
41+
def get_offices(args):
4842
"""
4943
1. Create an API Client with headers
5044
2. Get Offices via OfficesAPI
@@ -55,17 +49,16 @@ def get_offices(args) -> List[OfficeSummary]:
5549

5650
# Step 2. GET offices via OfficesAPI
5751
offices_api = OfficesApi(api_client=api_client)
58-
responses = offices_api.get_offices(
52+
response = offices_api.get_offices(
5953
account_id=args["account_id"]) # type: OfficeSummaryList
6054

61-
return responses.office_summaries
55+
return response.office_summaries
6256

6357
@staticmethod
6458
def worker(args):
6559
"""
66-
6760
1. Create an API client with headers
68-
2. Grant office access tp a form group via FormGroups API
61+
2. Grant office access to a form group via FormGroups API
6962
"""
7063

7164
# Step 1. Create an API client with headers

app/rooms/examples/eg008_grant_office_access_to_form_group/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def assign_office_to_form_group():
2727
return process_error(err)
2828

2929
# 3. Render the response
30-
3130
return render_template(
3231
"example_done.html",
3332
title="Assign office to a form group",

app/rooms/examples/eg009_assign_form_to_form_group/controller.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
from typing import List
2-
31
from docusign_rooms import (
4-
FormGroupSummary,
52
FormGroupsApi,
63
FormGroupSummaryList,
74
FormLibrariesApi,
85
FormGroupFormToAssign,
9-
FormSummary,
106
)
117
from docusign_rooms import FormSummaryList
128
from flask import session, request
@@ -16,36 +12,34 @@
1612

1713
class Eg009Controller:
1814
@staticmethod
19-
def get_args() -> dict:
15+
def get_args():
2016
"""Get required session and request arguments"""
2117
return {
22-
"account_id": session["ds_account_id"],
23-
# Represents your {ACCOUNT_ID}
24-
"access_token": session["ds_access_token"],
25-
# Represents your {ACCESS_TOKEN}
18+
"account_id": session["ds_account_id"], # Represents your {ACCOUNT_ID}
19+
"access_token": session["ds_access_token"], # Represents your {ACCESS_TOKEN}
2620
"form_group_id": request.form.get("form_group_id"),
27-
'form_id': request.form.get('form_id')
21+
"form_id": request.form.get("form_id")
2822
}
2923

3024
@staticmethod
31-
def get_form_groups(args) -> List[FormGroupSummary]:
25+
def get_form_groups(args):
3226
"""
3327
1. Create an API Client with headers
3428
2. GET Form Groups via FormGroupsAPI
3529
"""
3630

3731
# Step 1. Create an API with headers with headers
38-
api_client = create_rooms_api_client(access_token=args['access_token'])
32+
api_client = create_rooms_api_client(access_token=args["access_token"])
3933

4034
# Step 2. GET Form Groups via FormGroupsAPI
4135
form_groups_api = FormGroupsApi(api_client)
42-
responses = form_groups_api.get_form_groups(
43-
account_id=args['account_id']) # type: FormGroupSummaryList
36+
response = form_groups_api.get_form_groups(
37+
account_id=args["account_id"]) # type: FormGroupSummaryList
4438

45-
return responses.form_groups
39+
return response.form_groups
4640

4741
@staticmethod
48-
def get_forms(args) -> List[FormSummary]:
42+
def get_forms(args):
4943
"""
5044
1. Create an API client with headers
5145
2. Get first form library id
@@ -71,24 +65,24 @@ def get_forms(args) -> List[FormSummary]:
7165
return form_library_forms.forms
7266

7367
@staticmethod
74-
def worker(args) -> FormGroupFormToAssign:
68+
def worker(args):
7569
"""
7670
1. Create an API Client with headers
7771
2. Create FormGroupFormToAssign Object
7872
3. Assign form to a form group via FormGroups API
7973
"""
8074

8175
# Step 1. Create an API client with headers
82-
api_client = create_rooms_api_client(access_token=args['access_token'])
76+
api_client = create_rooms_api_client(access_token=args["access_token"])
8377
form_groups_api = FormGroupsApi(api_client)
8478

8579
# Step 2. Create FormGroupFormToAssign Object
8680
form_group_to_assign = FormGroupFormToAssign(form_id=args["form_id"],
8781
is_required=True)
8882

89-
# Step 3. Grant office access tp a form group via FormGroups API
83+
# Step 3. Assign form to a form group via FormGroups API
9084
response = form_groups_api.assign_form_group_form(
91-
form_group_id=args['form_group_id'], account_id=args['account_id'],
85+
form_group_id=args["form_group_id"], account_id=args["account_id"],
9286
body=form_group_to_assign
9387
) # type: FormGroupFormToAssign
9488

app/rooms/examples/eg009_assign_form_to_form_group/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
eg009 = Blueprint(eg, __name__)
1212

1313

14-
@eg009.route("/eg009", methods=['POST'])
14+
@eg009.route("/eg009", methods=["POST"])
1515
@authenticate(eg=eg)
1616
def assign_form_to_form_group():
1717
"""
@@ -44,7 +44,7 @@ def assign_form_to_form_group():
4444
)
4545

4646

47-
@eg009.route("/eg009", methods=['GET'])
47+
@eg009.route("/eg009", methods=["GET"])
4848
@authenticate(eg=eg)
4949
def get_view():
5050
"""

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ virtualenv==16.7.5
3030
virtualenv-clone==0.5.3
3131
Werkzeug==0.16.0
3232
wrapt==1.11.2
33-
pyjwt==1.7.1
3433

0 commit comments

Comments
 (0)