Skip to content

Commit a19b46c

Browse files
author
nianiB9
committed
Merge branch 'master' into DEVDOCS-16547
2 parents 3c440fe + 30441a4 commit a19b46c

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ For information about the scopes used for obtaining authorization to use the Mon
6565
For a list of code examples that use the Monitor API, see the [How-to guides overview](https://developers.docusign.com/docs/monitor-api/how-to/) on the Docusign Developer Center.
6666

6767

68-
## Notary API (closed beta)
69-
70-
**Note:** For closed beta participants interested in adding Notary API functionality to your production account, contact your Docusign representative.
68+
## Notary API
7169

7270
Example 1 requires a Sender Docusign developer account API account ID that has been provisioned for the [Notary API base URI](https://developers.docusign.com/docs/notary-api/go-live/).
7371

examples/Maestro/eg001TriggerWorkflow.sh

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fi
1515
#check that create workflow script ran successfully
1616
workflow_created=$(cat config/WORKFLOW_ID)
1717
if [ -z "$workflow_created" ]; then
18-
echo "please create a worklow before running this example"
18+
echo "Please create and publish a workflow before running this example."
1919
exit 0
2020
fi
2121

@@ -58,11 +58,31 @@ if [[ "$Status" -gt "201" ]]; then
5858
exit 0
5959
fi
6060

61-
echo "Response:"
61+
echo "Workflows found:"
6262
cat $response
6363
echo ""
6464

65-
workflow_id=$(grep -B 1 '"name": "Example workflow - send invite to signer"' $response | grep '"id":' | sed -n 's/.*"id": "\([^"]*\)".*/\1/p')
65+
workflow_ids=$(grep -B 3 -E '"status": "active"' "$response" | grep -B 2 '"name": "Example workflow - send invite to signer"' | grep '"id":' | sed -n 's/.*"id": "\([^"]*\)".*/\1/p')
66+
67+
# Read the existing workflow ID from the config file
68+
config_workflow_id=""
69+
if [ -s config/WORKFLOW_ID ]; then
70+
config_workflow_id=$(cat config/WORKFLOW_ID)
71+
fi
72+
73+
# If there are multiple active workflows, checks if the config_workflow_id is in the workflow list and uses the config_workflow_id.
74+
if [ -n "$config_workflow_id" ] && echo "$workflow_ids" | grep -q "$config_workflow_id"; then
75+
workflow_id="$config_workflow_id"
76+
else
77+
workflow_id=$(echo "$workflow_ids" | head -n 1)
78+
fi
79+
80+
# Error handling if no active workflow ID is found
81+
if [ -z "$workflow_id" ]; then
82+
echo "Error: No active workflow ID found in the response."
83+
echo "Please create and publish a workflow before running this example."
84+
exit 0
85+
fi
6686

6787
#apx-snippet-start:GetWorkflowTriggerRequirements
6888
# Get the trigger URL
@@ -81,7 +101,6 @@ if [[ "$Status" -gt "201" ]]; then
81101
exit 0
82102
fi
83103

84-
echo "Response:"
85104
cat $response
86105
echo ""
87106

examples/Maestro/lib/utils.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fi
88

99

1010
echo "This script uses the package uuidgen to create unique ids for workflow fields. If you do not already have this installed, please visit the Readme at link for installation instructions. If you are on Mac/linux, this is likely already installed."
11-
echo "Press any key to continue"
11+
echo "Press the enter key to continue."
1212
read continue
1313

1414
TEMPLATE_ID=$(cat config/TEMPLATE_ID)
@@ -588,18 +588,20 @@ do
588588
consent_url=`cat $response | grep consentUrl | sed 's/.*\"consentUrl\":\"//' | sed 's/\".*//'`
589589
echo ""
590590
echo "Please grant consent at the following url to publish this workflow: ${consent_url}&host=${redirect_url}"
591-
read -p "Press any key to continue"
591+
read -p "Press the enter key to continue."
592592
else
593593
echo $message
594594
exit 0
595595
fi
596596
else
597597
published="true"
598-
echo $workflow_id >config/WORKFLOW_ID
598+
echo "${workflow_id}" > config/WORKFLOW_ID
599+
echo "Please wait. The workflow is being published. This may take a few seconds."
600+
sleep 8
599601
echo "Successfully created and published workflow ${workflow_id}, ID saved to config/WORKFLOW_ID"
600602
fi
601603
done
602604

603605
# Remove the temporary files
604606
rm "$request_data"
605-
rm "$response"
607+
rm "$response"

0 commit comments

Comments
 (0)