Skip to content

Commit acf5456

Browse files
sriharip-docusign94farhansaferoombizthomasio101johannesheesterman
authored
Fix for retrieve recipient info by phone number action. (#2673)
* FLOW-225: Trigger do not work after connector upgrade from 2.0 to 2.1 xml parsing logic was missing * Port changes from Demo Connector to Prod Connector * FLOW-245: SMS authentication is missing in Add Verification Type to a recipient action * Insert a place holder instead of client id for the DocuSign Prod connector * Partner Center connector - new fields and deal registration actions (#2130) * Update apiDefinition.swagger.json * Latest changes * fix format warning * X-Caller_Id should be optional * Update apiDefinition.swagger.json Review changes - ->Added reg status and sub status fields. ->Update the fields descriptions as per api's details available on Microsoft public site. ->Remove submission related fields. ->Mark registration status field as read only. ->Remove offerId from root. ->Use Enum values in Create deal registration model. ->Create a separate model for update deal registration. Create a separate action for update deal registration. * Update apiDefinition.swagger.json * Update apiDefinition.swagger.json Add deprecate text in Update a referral by Id action * Update apiDefinition.swagger.json Connector status keep as Preview and UpdateReferralById deprecated keep as false but deprecated word in description. * Update apiDefinition.swagger.json update deal registration success message. * Update apiDefinition.swagger.json added title for registration object * FLOW-251: Add an action to get the deployed build number * Update the action name * Bitskout Connector (#2140) * Bitskout Connector * Requested changes * EC-14395 Make it so fields aren't required anymore for updates (#2150) * Added orderby parameter * Added orderby parameter * feat: add x-ms-pageable extension * feat: add updatenextlink policy instance * refactor: whitespace refactoring * Update apiProperties.json * fix(EC-14395): Integrate the patch schema endpoint * fix(EC-14395): Add specs for the schema endpoint's responses * fix(EC-14395): Add required fields to the schema Co-authored-by: Johannes Heesterman <johannes@elfsquad.io> Co-authored-by: johannesheesterman <heestermanj@gmail.com> Co-authored-by: Stan van Rooy <stanvanrooy6@gmail.com> * FLOW-270: Phone Authentication verification failing with INVALIDPHONENUMBERPROVIDED * FLOW-275 - Restore v1 Create Template Step and rename action names * FLOW-278: Get Envelope Custom Fields Step * Expose field id and name in the get envelope custom field step * FLOW-276: Update Envelope Custom Fields Step * Add envlope and click events * addressing feedback. Alignement fixed. Comments added on backward compatibility * Remove the duplicate event * Update the response schema to return just the custom field that got updated instead of the array * FLOW-282: Add unique tab label for all tab types * FLOW-294: Replace the dropdown for update ecf by text and deprecate v2 version of create from template action * The 'summary' value goes over the character limit '80'. Shortened it. * FLOW-292: witness "name" should not be displayed as a required field * Don't show V2 in the deprecated version of create envelope using template * FLOW-271: Power Automate: Unable to turn off and turn back on, a flow, that uses connect trigger * Adding delete hook for v3 trigger * FLOW-312 - Value property needs to be part the output field in Get envelope custom field action * FLOW-338: template prefill : in create from template action , add support for email subject and body * UI is added * Phone and SMS recipients added to the solution * Add all the signer properties to the output * Add + to the trip character array * Indendation fixed * Implement feedback * FLOW-343: update recipient action * support SMS delivery * support all recipient types * remove the extra forward slash * Implemented GetRecipientFields for all the recipient types * Remove signers array * Remove double referencing. Add signer object to an array * remove the extra blank line * FLOW-345: DocGen: Get document id given a document name * Code optimization implemented * UI of the GetTabValues * Lower case the labels * Updated the custom action title * Updated the operationId * Fix bug around no-match found * Convert token to string before matching * Get Tab Info method implementation added * Validation added to check if tab label provided is missing * UI is added. Script needs little work * Removed the string conversion tabLabel * able to output 1 tab * FLOW-348: List Templates Action for Power Automate Expose it , so that Microsoft's maker / c2 experience can leverage. * Fix the meal db connector issue * no message * Working code generating output. The body data needs to be added * Document details are returned * FLOW-377: c2: Sender/Signer can create an envelope from a template using a variable for the template ID * Add validation message * Rewrite request url for /envelopes/createFromTemplateNoRecipients endpoint * Operation Id updated * Add the shortform to create array of objects * Get template documents action added * Updated the description * Removed the x-ms-visibility property * fixed the indendation * FLOW-374: c2 get document tabs from envelope * Update the schema for Tab with additional properties * Recipient tabs test case added * Add validation statement * Removing the duplicate code * UI fix * Get template document tabs added * ListEnvelopeDocumentFields custom action added * Update UI * FLOW-365: c2: update envelope prefill tabs * Rename field identifier to match the internal names * Fix description grammar * Add a field to indicate whether a tab is prefill or not for the get action * UI added * FLOW-346: DocGen - Get merge fields * UpdateRecipientTabs added * Removed StaticResponse * REmoved StaticResponseForTabTypesWithValues * Remove the ms-visibility * FLOW-347: DocGen: Update merge fields * Add a check if the email token exists in the signer objects * Optimize the if statement * Bump the build number for C2/R2 release * Add back the removed Meal DB/Readme.md file * FLOW-392: Get document id action should return both id and guid * Expose template id in the output of create envelope using template actions * Add GetEnvelopeDocumentFields custom method * Added delivery phone and SMS phone options * formating the code * convert template input to a template dropdown * Rename actions to make it more readable for the user * Update doc gen action name --------- Co-authored-by: Farhan <103836444+94farhan@users.noreply.github.com> Co-authored-by: saferoombiz <32263053+saferoombiz@users.noreply.github.com> Co-authored-by: Tess Ellenoir Duursma <thomasduursma@outlook.com> Co-authored-by: Johannes Heesterman <johannes@elfsquad.io> Co-authored-by: johannesheesterman <heestermanj@gmail.com> Co-authored-by: Stan van Rooy <stanvanrooy6@gmail.com> Co-authored-by: harshitav-docusign <118772192+harshitav-docusign@users.noreply.github.com> Co-authored-by: Harshita Vinnakota <harshita.vinnakota@docusign.com> Co-authored-by: Angel Garcia Reyes <105454462+angelga-docusign@users.noreply.github.com> Co-authored-by: Mahbub Murshed <48570820+mamurshe@users.noreply.github.com>
1 parent e5c6f46 commit acf5456

File tree

2 files changed

+71
-59
lines changed

2 files changed

+71
-59
lines changed

certified-connectors/DocuSignDemo/apiDefinition.swagger.json

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@
286286
"tags": [
287287
"DocuSign"
288288
],
289-
"summary": "Get envelope docgen form fields",
290-
"description": "Get the docgen fields from envelope documents.",
289+
"summary": "Get document generation form fields from envelope",
290+
"description": "Get document generation form fields from envelope",
291291
"operationId": "GetDocgenFormFields",
292292
"consumes": [
293293
"application/json",
@@ -344,8 +344,8 @@
344344
"tags": [
345345
"DocuSign"
346346
],
347-
"summary": "Update envelope docgen form fields",
348-
"description": "Update the docgen fields in envelope documents.",
347+
"summary": "Update document generation form fields from envelope",
348+
"description": "Update document generation form fields from envelope",
349349
"operationId": "UpdateDocgenFormFields",
350350
"x-ms-no-generic-test": true,
351351
"consumes": [
@@ -416,7 +416,7 @@
416416
}
417417
}
418418
},
419-
"x-ms-summary": "Field"
419+
"x-ms-summary": "Field"
420420
}
421421
}
422422
],
@@ -431,8 +431,8 @@
431431
},
432432
"/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}": {
433433
"get": {
434-
"summary": "Get envelope documents",
435-
"description": "Get envelope documents.",
434+
"summary": "Get documents from envelope",
435+
"description": "Get documents from envelope",
436436
"operationId": "GetDocuments",
437437
"parameters": [
438438
{
@@ -495,8 +495,8 @@
495495
},
496496
"/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/tabs": {
497497
"get": {
498-
"summary": "Get envelope document tabs",
499-
"description": "Get envelope document tabs.",
498+
"summary": "Get document tabs from envelope",
499+
"description": "Get document tabs from envelope",
500500
"operationId": "GetEnvelopeDocumentTabs",
501501
"parameters": [
502502
{
@@ -640,8 +640,8 @@
640640
},
641641
"/accounts/{accountId}/templates/{templateId}/documents/{documentId}/tabs": {
642642
"get": {
643-
"summary": "Get template document tabs",
644-
"description": "Get template document tabs.",
643+
"summary": "Get document tabs from template",
644+
"description": "Get document tabs from template",
645645
"operationId": "GetTemplateDocumentTabs",
646646
"parameters": [
647647
{
@@ -692,8 +692,8 @@
692692
},
693693
"/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/fields": {
694694
"get": {
695-
"summary": "Get envelope document custom fields",
696-
"description": "Get custom document fields of envelope document.",
695+
"summary": "Get document custom fields from envelope",
696+
"description": "Get document custom fields from envelope",
697697
"operationId": "GetEnvelopeDocumentFields",
698698
"parameters": [
699699
{
@@ -1250,8 +1250,8 @@
12501250
"tags": [
12511251
"DocuSign"
12521252
],
1253-
"summary": "Get envelope custom field",
1254-
"description": "Get details for the specified envelope custom field.",
1253+
"summary": "Get custom field info from envelope",
1254+
"description": "Get custom field info from envelope",
12551255
"operationId": "GetEnvelopeCustomField",
12561256
"consumes": [
12571257
"application/json",
@@ -1633,8 +1633,8 @@
16331633
"tags": [
16341634
"DocuSign"
16351635
],
1636-
"summary": "List recipients",
1637-
"description": "List recipients for a specific envelope.",
1636+
"summary": "List recipients from envelope",
1637+
"description": "List recipients from envelope",
16381638
"operationId": "GetRecipientStatus",
16391639
"consumes": [],
16401640
"produces": [
@@ -1918,8 +1918,8 @@
19181918
"tags": [
19191919
"DocuSign"
19201920
],
1921-
"summary": "Get recipient fields",
1922-
"description": "Returns the recipient information associated with an envelope.",
1921+
"summary": "Get recipient info from envelope",
1922+
"description": "Get recipient info from envelope",
19231923
"operationId": "GetRecipientFields",
19241924
"consumes": [],
19251925
"produces": [
@@ -2276,8 +2276,8 @@
22762276
"tags": [
22772277
"DocuSign"
22782278
],
2279-
"summary": "Update envelope recipient",
2280-
"description": "Update envelope recipient.",
2279+
"summary": "Update recipient on an envelope",
2280+
"description": "Update recipient on an envelope",
22812281
"operationId": "UpdateEnvelopeRecipient",
22822282
"consumes": [
22832283
"application/json",
@@ -2554,8 +2554,8 @@
25542554
"tags": [
25552555
"DocuSign"
25562556
],
2557-
"summary": "Get custom fields",
2558-
"description": "Returns a list of custom fields associated with an account.",
2557+
"summary": "Get custom fields from an account",
2558+
"description": "Get custom fields from an account",
25592559
"operationId": "GetCustomFields",
25602560
"consumes": [],
25612561
"produces": [
@@ -2964,8 +2964,8 @@
29642964
"tags": [
29652965
"DocuSign"
29662966
],
2967-
"summary": "List template documents",
2968-
"description": "List documents in a template.",
2967+
"summary": "List documents from a template",
2968+
"description": "List documents from a template",
29692969
"operationId": "ListTemplateDocuments",
29702970
"consumes": [],
29712971
"produces": [
@@ -2997,6 +2997,18 @@
29972997
"required": true,
29982998
"x-ms-summary": "Template",
29992999
"x-ms-test-value": "insert template id",
3000+
"x-ms-visibility": "important",
3001+
"x-ms-dynamic-values": {
3002+
"operationId": "GetEnvelopeTemplates",
3003+
"parameters": {
3004+
"accountId": {
3005+
"parameter": "accountId"
3006+
}
3007+
},
3008+
"value-collection": "envelopeTemplates",
3009+
"value-path": "templateId",
3010+
"value-title": "name"
3011+
},
30003012
"type": "string"
30013013
}
30023014
],
@@ -3017,8 +3029,8 @@
30173029
"tags": [
30183030
"DocuSign"
30193031
],
3020-
"summary": "List envelope documents",
3021-
"description": "List documents in an envelope.",
3032+
"summary": "List documents from a envelope",
3033+
"description": "List documents from a envelope",
30223034
"operationId": "ListEnvelopeDocuments",
30233035
"consumes": [],
30243036
"produces": [
@@ -3065,11 +3077,11 @@
30653077
"x-ms-visibility": "advanced"
30663078
}
30673079
},
3068-
"/accounts/{accountId}/envelopes/{envelopeId}/get_document_id": {
3080+
"/accounts/{accountId}/envelopes/{envelopeId}/get_document_info": {
30693081
"get": {
3070-
"summary": "Get envelope document id",
3071-
"description": "Get envelope document id",
3072-
"operationId": "GetEnvelopeDocumentId",
3082+
"summary": "Get document info from envelope",
3083+
"description": "Get document info from envelope",
3084+
"operationId": "GetEnvelopeDocumentInfo",
30733085
"parameters": [
30743086
{
30753087
"name": "accountId",
@@ -3169,8 +3181,8 @@
31693181
"tags": [
31703182
"DocuSign"
31713183
],
3172-
"summary": "Add tabs for a recipient",
3173-
"description": "Add tabs for a recipient.",
3184+
"summary": "Add tabs for a recipient on an envelope",
3185+
"description": "Add tabs for a recipient on an envelope",
31743186
"operationId": "AddRecipientTabs",
31753187
"parameters": [
31763188
{
@@ -3316,8 +3328,8 @@
33163328
"tags": [
33173329
"DocuSign"
33183330
],
3319-
"summary": "Update envelope recipient tabs values",
3320-
"description": "Updates one or more tabs for a recipient in a draft envelope.",
3331+
"summary": "Update recipient tab values on an envelope",
3332+
"description": "Update recipient tab values on an envelope",
33213333
"operationId": "UpdateRecipientTabsValues",
33223334
"parameters": [
33233335
{
@@ -3403,8 +3415,8 @@
34033415
"tags": [
34043416
"DocuSign"
34053417
],
3406-
"summary": "Get envelope recipient tabs",
3407-
"description": "Get envelope recipient tabs.",
3418+
"summary": "Get recipient tabs from envelope",
3419+
"description": "Get recipient tabs from envelope",
34083420
"operationId": "GetEnvelopeRecipientTabs",
34093421
"consumes": [],
34103422
"produces": [

certified-connectors/DocuSignDemo/script.csx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,10 +1752,10 @@ public class Script : ScriptBase
17521752
this.Context.Request.RequestUri = uriBuilder.Uri;
17531753
}
17541754

1755-
if ("GetEnvelopeDocumentId".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
1755+
if ("GetEnvelopeDocumentInfo".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
17561756
{
17571757
var uriBuilder = new UriBuilder(this.Context.Request.RequestUri);
1758-
uriBuilder.Path = uriBuilder.Path.Replace("/get_document_id", "/documents");
1758+
uriBuilder.Path = uriBuilder.Path.Replace("/get_document_info", "/documents");
17591759
this.Context.Request.RequestUri = uriBuilder.Uri;
17601760
}
17611761

@@ -2051,28 +2051,23 @@ public class Script : ScriptBase
20512051
{
20522052
phoneNumber = phoneNumber.Trim(charsToTrimPhoneNumber);
20532053

2054-
if (signer.ToString().Contains("phoneAuthentication"))
2055-
{
2056-
signerPhoneNumber = signer["phoneAuthentication"]["senderProvidedNumbers"][0].ToString();
2057-
signerPhoneNumber = signerPhoneNumber.Trim(charsToTrimPhoneNumber);
2054+
signerPhoneNumber =
2055+
signer.ToString().Contains("phoneAuthentication") ?
2056+
signer["phoneAuthentication"]["senderProvidedNumbers"][0].ToString()
2057+
: signer.ToString().Contains("additionalNotifications") ?
2058+
signer["additionalNotifications"][0]["phoneNumber"]["countryCode"].ToString() + " " +
2059+
signer["additionalNotifications"][0]["phoneNumber"]["number"].ToString()
2060+
: signer.ToString().Contains("phoneNumber") ?
2061+
signer["phoneNumber"]["countryCode"].ToString() + " " + signer["phoneNumber"]["number"].ToString()
2062+
: signer.ToString().Contains("smsAuthentication") ?
2063+
signer["smsAuthentication"]["senderProvidedNumbers"][0].ToString() : "0";
20582064

2059-
if (phoneNumber.ToString().Equals(signerPhoneNumber))
2060-
{
2061-
matchingSigner = signer as JObject;
2062-
break;
2063-
}
2064-
}
2065+
signerPhoneNumber = signerPhoneNumber.Trim(charsToTrimPhoneNumber);
20652066

2066-
if (signer.ToString().Contains("smsAuthentication"))
2067+
if (phoneNumber.ToString().Equals(signerPhoneNumber))
20672068
{
2068-
signerPhoneNumber = signer["smsAuthentication"]["senderProvidedNumbers"][0].ToString();
2069-
signerPhoneNumber = signerPhoneNumber.Trim(charsToTrimPhoneNumber);
2070-
2071-
if (phoneNumber.ToString().Equals(signerPhoneNumber))
2072-
{
2073-
matchingSigner = signer as JObject;
2074-
break;
2075-
}
2069+
matchingSigner = signer as JObject;
2070+
break;
20762071
}
20772072
}
20782073
}
@@ -2082,6 +2077,11 @@ public class Script : ScriptBase
20822077
{
20832078
throw new ConnectorException(HttpStatusCode.BadRequest, "ValidationFailure: Please fill either Recipient Email or Phone Number to retrieve Recipient information");
20842079
}
2080+
2081+
if (string.IsNullOrEmpty((string)matchingSigner["recipientIdGuid"]))
2082+
{
2083+
throw new ConnectorException(HttpStatusCode.BadRequest, "ValidationFailure: No recipient found for the given information");
2084+
}
20852085
else
20862086
{
20872087
newBody["recipientId"] = matchingSigner["recipientId"];
@@ -2415,7 +2415,7 @@ public class Script : ScriptBase
24152415
response.Content = new StringContent(newBody.ToString(), Encoding.UTF8, "application/json");
24162416
}
24172417

2418-
if ("GetEnvelopeDocumentId".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
2418+
if ("GetEnvelopeDocumentInfo".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
24192419
{
24202420
var body = ParseContentAsJObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), false);
24212421
var query = HttpUtility.ParseQueryString(this.Context.Request.RequestUri.Query);

0 commit comments

Comments
 (0)