diff --git a/certified-connectors/DocuSignDemo/apiDefinition.swagger.json b/certified-connectors/DocuSignDemo/apiDefinition.swagger.json index 619d2c8a0..e92f62f99 100644 --- a/certified-connectors/DocuSignDemo/apiDefinition.swagger.json +++ b/certified-connectors/DocuSignDemo/apiDefinition.swagger.json @@ -479,7 +479,7 @@ "deprecated": false, "x-ms-visibility": "important" } - }, + }, "/accounts/{accountId}/envelopes": { "post": { "tags": [ @@ -637,6 +637,219 @@ "x-ms-visibility": "important" } }, + "/accounts/{accountId}/envelopes/{envelopeId}/views/sender": { + "post": { + "tags":[ + "DocuSign" + ], + "summary": "Generate Embedded Sender URL", + "description": "Generate Embedded Sender URL", + "operationId": "GenerateEmbeddedSenderURL", + "consumes":[ + "application/json", + "text/json", + "application/xml", + "text/xml", + "application/x-www-form-urlencoded" + ], + "produces":[ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters":[ + { + "name": "accountId", + "in": "path", + "description": "Account id", + "required": true, + "x-ms-summary": "Account", + "x-ms-test-value": "insert account id", + "x-ms-dynamic-values": { + "operationId": "GetLoginAccounts", + "value-collection": "loginAccounts", + "value-path": "accountIdGuid", + "value-title": "name" + }, + "type": "string" + }, + { + "name": "envelopeId", + "in": "path", + "description": "Envelope id", + "required": true, + "x-ms-summary": "Envelope", + "x-ms-test-value": "insert envelope id", + "type": "string" + }, + { + "name": "openIn", + "in":"query", + "description": "Open in", + "required":true, + "x-ms-summary": "Open in", + "x-ms-visibility":"important", + "type":"string", + "enum":["Prepare", "Tagging"], + "default": "Prepare" + }, + { + "name": "returnUrl", + "in":"query", + "description": "Return URL", + "required":true, + "x-ms-summary": "Return URL", + "x-ms-visibility":"important", + "type":"string", + "enum":["DocuSign homepage", "Add a different URL"], + "default": "DocuSign homepage" + }, + { + "name": "additionalURL", + "in": "body", + "description": "Additional added URL.", + "schema": { + "$ref": "#/definitions/AdditionalURLForSenderView" + }, + "x-ms-summary": "Additional added URL", + "x-ms-visibility": "advanced" + } + ], + "responses": { + "201": { + "description": "OK", + "schema": { + "$ref": "#/definitions/EmbeddedSenderResponse" + } + } + }, + "deprecated":false, + "x-ms-visibility": "important", + "x-ms-no-generic-test": true + } + }, + "/accounts/{accountId}/envelopes/{envelopeId}/views/recipient":{ + "post":{ + "tags":[ + "DocuSign" + ], + "summary": "Generate Embedded Signing URL", + "description": "Generate Embedded Signing URL", + "operationId": "GenerateEmbeddedSigningURL", + "consumes": [ + "application/json", + "text/json", + "application/xml", + "text/xml", + "application/x-www-form-urlencoded" + ], + "produces": [ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters": [ + { + "name": "accountId", + "in": "path", + "description": "Account id", + "required": true, + "x-ms-summary": "Account", + "x-ms-test-value": "insert account id", + "x-ms-dynamic-values": { + "operationId": "GetLoginAccounts", + "value-collection": "loginAccounts", + "value-path": "accountIdGuid", + "value-title": "name" + }, + "type": "string" + }, + { + "name": "envelopeId", + "in": "path", + "description": "Envelope id", + "required": true, + "x-ms-summary": "Envelope", + "x-ms-test-value": "insert envelope id", + "type": "string" + }, + { + "name": "signerName", + "in": "query", + "description": "Name of The Signer", + "required": true, + "x-ms-summary": "Signer Name", + "x-ms-test-value": "test name", + "x-ms-visibility": "important", + "type": "string" + }, + { + "name": "signerEmail", + "in": "query", + "description": "Email of The Signer", + "required": true, + "x-ms-summary": "Signer Email", + "x-ms-test-value": "test@email.com", + "x-ms-visibility": "important", + "type": "string" + }, + { + "name": "clientUserId", + "in": "query", + "description": "Client User ID", + "required": true, + "x-ms-summary": "Client User ID", + "x-ms-visibility": "important", + "type": "string" + }, + { + "name": "authenticationMethod", + "in":"query", + "description": "Authentication Method", + "required":true, + "x-ms-summary": "Authentication Method", + "x-ms-visibility": "important", + "type":"string", + "enum":["Biometric", "Email", "HTTPBasicAuth", "Kerberos", "KnowledgeBasedAuth", "None", "PaperDocuments", "Password", "RSASecureID", "SingleSignOn_CASiteminder", "SingleSignOn_InfoCard", "SingleSignOn_MicrosoftActiveDirectory", "SingleSignOn_Other", "SingleSignOn_Passport", "SingleSignOn_SAML", "Smartcard", "SSLMutualAuth", "X509Certificate"], + "default": "None" + }, + { + "name": "returnUrl", + "in":"query", + "description": "Return URL", + "required":true, + "x-ms-summary": "Return URL", + "x-ms-visibility":"important", + "type":"string", + "enum":["Default URL", "Add a different URL"], + "default": "Default URL" + }, + { + "name": "additionalURL", + "in": "body", + "description": "Additional added URL.", + "schema": { + "$ref": "#/definitions/AdditionalURL" + }, + "x-ms-summary": "Additional added URL", + "x-ms-visibility": "advanced" + } + ], + "responses": { + "201": { + "description": "OK", + "schema": { + "$ref": "#/definitions/EmbeddedSigningResponse" + } + } + }, + "deprecated": false, + "x-ms-visibility": "important", + "x-ms-no-generic-test": true + } + }, "/accounts/{accountId}/envelopes/{envelopeId}/recipients": { "get": { "tags": [ @@ -980,6 +1193,15 @@ "value-title": "name" } }, + { + "name": "clientUserId", + "in": "query", + "description": "Client user ID for embedded signer", + "required": false, + "x-ms-summary": "Client User ID", + "x-ms-visibility": "advanced", + "type": "string" + }, { "name": "routingOrder", "in": "query", @@ -1097,6 +1319,85 @@ "x-ms-visibility": "important", "x-ms-no-generic-test": true }, + "put": { + "tags": [ + "DocuSign" + ], + "summary": "Add verification type to a recipient", + "description": "Add verification type to a recipient.", + "operationId": "AddVerificationToRecipient", + "parameters": [ + { + "name": "accountId", + "in": "path", + "description": "Account id", + "required": true, + "x-ms-summary": "Account", + "x-ms-test-value": "insert account id", + "x-ms-dynamic-values": { + "operationId": "GetLoginAccounts", + "value-collection": "loginAccounts", + "value-path": "accountIdGuid", + "value-title": "name" + }, + "type": "string" + }, + { + "name": "envelopeId", + "in": "path", + "description": "Envelope id", + "required": true, + "x-ms-summary": "Envelope", + "x-ms-test-value": "insert envelope id", + "type": "string" + }, + { + "name": "recipientId", + "in": "query", + "description": "Recipient id", + "x-ms-summary": "Recipient id", + "required": true, + "type": "string" + }, + { + "name": "recipientType", + "in": "query", + "description": "Recipient type", + "x-ms-summary": "Recipient type", + "required": true, + "type": "string" + }, + { + "name": "verificationType", + "in": "query", + "required": true, + "type": "string", + "description": "Verification Type", + "x-ms-summary": "Verification Type", + "enum":["None", "Access Code", "ID Verification", "Phone Authentication", "Knowledge Based"], + "default": "None" + }, + { + "name": "additionalRecipientData", + "in": "body", + "description": "Additional recipient data.", + "schema": { + "$ref": "#/definitions/AdditionalRecipientData" + }, + "x-ms-summary": "Additional recipient data", + "x-ms-visibility": "advanced" + } + ], + "responses": { + "201": { + "description": "OK", + "schema": {} + } + }, + "deprecated": false, + "x-ms-visibility": "important", + "x-ms-no-generic-test": true + } }, "/login_information": { "get": { @@ -1124,6 +1425,49 @@ "deprecated": false } }, + "/accounts/{accountId}/identity_verification": { + "get": { + "tags":[ + "DocuSign" + ], + "summary":"Workflow Ids", + "description":"Get workflow ids", + "operationId":"GetWorkflowIDs", + "consumes": [], + "produces": [ + "application/json", + "text/json", + "application/xml", + "text/xml" + ], + "parameters": [ + { + "name": "accountId", + "in": "path", + "description": "Account id", + "required": true, + "x-ms-summary": "Account", + "x-ms-test-value": "insert account id", + "x-ms-dynamic-values": { + "operationId": "GetLoginAccounts", + "value-collection": "loginAccounts", + "value-path": "accountIdGuid", + "value-title": "name" + }, + "type": "string" + }], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/GetWorkFlowIdsResponse" + } + } + }, + "deprecated": false, + "x-ms-visibility": "internal" + } + }, "/accounts/{accountId}/custom_fields": { "get": { "tags": [ @@ -1735,6 +2079,90 @@ "x-ms-visibility": "internal" } }, + "/embeddedSigning_schema": { + "get": { + "tags": [ + "StaticResponse" + ], + "description": "Get schema for return URL.", + "operationId": "StaticResponseForEmbeddedSigningSchema", + "parameters": [ + { + "name": "returnUrl", + "in": "query", + "required": true, + "type": "string", + "x-ms-summary": "Return URL" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + } + }, + "deprecated": false, + "x-ms-visibility": "internal" + } + }, + "/embeddedSender_schema": { + "get": { + "tags": [ + "StaticResponse" + ], + "description": "Get schema for return URL.", + "operationId": "StaticResponseForEmbeddedSenderSchema", + "parameters": [ + { + "name": "returnUrl", + "in": "query", + "required": true, + "type": "string", + "x-ms-summary": "Return URL" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + } + }, + "deprecated": false, + "x-ms-visibility": "internal" + } + }, + "/verificationtype_schema": { + "get": { + "tags": [ + "StaticResponse" + ], + "description": "Get schema for a verification type.", + "operationId": "StaticResponseForVerificationTypeSchema", + "parameters": [ + { + "name": "verificationType", + "in": "query", + "required": true, + "type": "string", + "x-ms-summary": "Verification Type" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + } + }, + "deprecated": false, + "x-ms-visibility": "internal" + } + }, "/font_faces": { "get": { "tags": [ @@ -1978,6 +2406,12 @@ "x-ms-summary": "Recipient Type", "x-ms-visibility": "advanced" }, + "verificationType": { + "description": "The type of the verification.", + "type": "string", + "x-ms-summary": "Verification Type", + "x-ms-visibility": "important" + }, "name": { "description": "The name of the recipient.", "type": "string", @@ -2258,6 +2692,48 @@ "value-path": "Schema" } }, + "AdditionalRecipientData": { + "description": "An object that represents additional parameters of a recipient.", + "type": "object", + "properties": {}, + "x-ms-dynamic-schema": { + "operationId": "StaticResponseForVerificationTypeSchema", + "parameters": { + "verificationType": { + "parameter": "verificationType" + } + }, + "value-path":"Schema" + } + }, + "AdditionalURLForSenderView": { + "description": "Addtional Return URL", + "type": "object", + "properties": {}, + "x-ms-dynamic-schema": { + "operationId": "StaticResponseForEmbeddedSenderSchema", + "parameters": { + "returnUrl": { + "parameter": "returnUrl" + } + }, + "value-path":"Schema" + } + }, + "AdditionalURL": { + "description": "Addtional Return URL", + "type": "object", + "properties": {}, + "x-ms-dynamic-schema": { + "operationId": "StaticResponseForEmbeddedSigningSchema", + "parameters": { + "returnUrl": { + "parameter": "returnUrl" + } + }, + "value-path":"Schema" + } + }, "AccountCustomFields": { "description": "An object that represents custom fields.", "type": "object", @@ -2377,6 +2853,28 @@ } } }, + "EmbeddedSenderResponse":{ + "type":"object", + "properties": { + "url": { + "description": "The url of embedded sender view.", + "type": "string", + "x-ms-summary": "Embedded Sender URL", + "x-ms-visibility": "important" + } + } + }, + "EmbeddedSigningResponse": { + "type":"object", + "properties": { + "url": { + "description": "The url of embedded signing view.", + "type": "string", + "x-ms-summary": "URL", + "x-ms-visibility": "important" + } + } + }, "CreateEnvelopeResponse": { "type": "object", "properties": { @@ -2462,6 +2960,12 @@ "type": "string", "x-ms-summary": "Recipient Type", "x-ms-visibility": "important" + }, + "verificationType": { + "description": "The type of verification.", + "type": "string", + "x-ms-summary": "Verification Type", + "x-ms-visibility": "important" } } }, @@ -2479,6 +2983,20 @@ } } }, + "GetWorkFlowIdsResponse": { + "type": "object", + "properties": { + "workflowIds": { + "description": "Workflow ID", + "type": "array", + "items": { + "$ref": "#/definitions/WorkflowID" + }, + "x-ms-summary": "Workflow IDs", + "x-ms-visibility": "advanced" + } + } + }, "LoginAccount": { "required": [ "accountIdGuid" @@ -2575,6 +3093,22 @@ } } }, + "WorkflowID": { + "type": "object", + "properties": { + "name": { + "description": "The name of workflowID", + "type": "string", + "x-ms-summary": "Name" + }, + "type": { + "description": "The type of workflowID", + "type": "string", + "x-ms-summary": "Type", + "x-ms-visibility": "advanced" + } + } + }, "RecipientType": { "type": "object", "properties": { diff --git a/certified-connectors/DocuSignDemo/script.csx b/certified-connectors/DocuSignDemo/script.csx index 9b29d51a4..4f33d4e57 100644 --- a/certified-connectors/DocuSignDemo/script.csx +++ b/certified-connectors/DocuSignDemo/script.csx @@ -242,6 +242,138 @@ public class Script : ScriptBase } } + if (operationId.Equals("StaticResponseForEmbeddedSigningSchema", StringComparison.OrdinalIgnoreCase)) + { + var query = HttpUtility.ParseQueryString(context.Request.RequestUri.Query); + var returnUrl = query.Get("returnUrl"); + + response["name"] = "dynamicSchema"; + response["title"] = "dynamicSchema"; + response["schema"] = new JObject + { + ["type"] = "object", + ["properties"] = new JObject() + }; + + if (returnUrl.Equals("Add A Different URL", StringComparison.OrdinalIgnoreCase)) + { + response["schema"]["properties"]["returnURL"] = new JObject + { + ["type"] = "string", + ["x-ms-summary"] = "* Add Return URL" + }; + } + else { + response["schema"] = null; + } + } + + if (operationId.Equals("StaticResponseForEmbeddedSenderSchema", StringComparison.OrdinalIgnoreCase)) + { + var query = HttpUtility.ParseQueryString(context.Request.RequestUri.Query); + var returnUrl = query.Get("returnUrl"); + + response["name"] = "dynamicSchema"; + response["title"] = "dynamicSchema"; + response["schema"] = new JObject + { + ["type"] = "object", + ["properties"] = new JObject() + }; + + if (returnUrl.Equals("Add a different URL", StringComparison.OrdinalIgnoreCase)) + { + response["schema"]["properties"]["returnURL"] = new JObject + { + ["type"] = "string", + ["x-ms-summary"] = "* Add Return URL" + }; + } + else { + response["schema"] = null; + } + } + + if (operationId.Equals("StaticResponseForVerificationTypeSchema", StringComparison.OrdinalIgnoreCase)) + { + var query = HttpUtility.ParseQueryString(context.Request.RequestUri.Query); + var verificationType = query.Get("verificationType"); + + response["name"] = "dynamicSchema"; + response["title"] = "dynamicSchema"; + response["schema"] = new JObject + { + ["type"] = "object", + ["properties"] = new JObject() + }; + + if (verificationType.Equals("Phone Authentication", StringComparison.OrdinalIgnoreCase)) + { + response["schema"]["properties"]["countryCode"] = new JObject + { + ["type"] = "string", + ["x-ms-summary"] = "* Country Code (+)" + }; + response["schema"]["properties"]["phoneNumber"] = new JObject + { + ["type"] = "string", + ["x-ms-summary"] = "* Recipient's Phone Number" + }; + response["schema"]["properties"]["workflowID"] = new JObject + { + ["type"] = "string", + ["x-ms-dynamic-values"] = new JObject + { + ["operationId"] = "GetWorkflowIDs", + ["parameters"] = new JObject + { + ["accountId"] = new JObject + { + ["parameter"] = "accountId" + } + }, + ["value-collection"] = "workFlowIds", + ["value-path"] = "type", + ["value-title"] = "name", + }, + ["x-ms-summary"] = "* Workflow IDs" + }; + } + else if (verificationType.Equals("Access Code", StringComparison.OrdinalIgnoreCase)) + { + response["schema"]["properties"]["accessCode"] = new JObject + { + ["type"] = "string", + ["x-ms-summary"] = "* Access Code" + }; + } + else if (verificationType.Equals("ID Verification", StringComparison.OrdinalIgnoreCase)) + { + response["schema"]["properties"]["workflowID"] = new JObject + { + ["type"] = "string", + ["x-ms-dynamic-values"] = new JObject + { + ["operationId"] = "GetWorkflowIDs", + ["parameters"] = new JObject + { + ["accountId"] = new JObject + { + ["parameter"] = "accountId" + } + }, + ["value-collection"] = "workFlowIds", + ["value-path"] = "type", + ["value-title"] = "name", + }, + ["x-ms-summary"] = "* Workflow IDs" + }; + } + else { + response["schema"] = null; + } + } + if (operationId.Equals("StaticResponseForRecipientTypeSchema", StringComparison.OrdinalIgnoreCase)) { var query = HttpUtility.ParseQueryString(context.Request.RequestUri.Query); @@ -844,6 +976,122 @@ public class Script : ScriptBase return body; } + private JObject GenerateEmbeddedSigningURLBodyTransformation (JObject body) + { + var query = HttpUtility.ParseQueryString(this.Context.Request.RequestUri.Query); + body["userName"] = query.Get("signerName"); + body["email"] = query.Get("signerEmail"); + body["authenticationMethod"] = query.Get("authenticationMethod"); + body["clientUserId"] = query.Get("clientUserId"); + + var returnUrl = query.Get("returnUrl"); + if (returnUrl.Equals("Default URL")) + { + body["returnUrl"] = "https://postsign.docusign.com/postsigning/en/finish-signing"; + } + else if (returnUrl.Equals("Add A Different URL")) + { + body["returnUrl"] = body["returnURL"]; + } + + return body; + } + + private JObject GenerateEmbeddedSenderURLBodyTransformation (JObject body) + { + var query = HttpUtility.ParseQueryString(this.Context.Request.RequestUri.Query); + var returnUrl = query.Get("returnUrl"); + var url = this.Context.Request.RequestUri.Authority; + + if (returnUrl.Equals("DocuSign homepage")) + { + if (url.Equals("demo.docusign.net")) + { + body["returnUrl"] = "https://appdemo.docusign.com/"; + } + else + { + body["returnUrl"] = "https://app.docusign.com/"; + } + } + else + { + body["returnUrl"] = body["returnURL"]; + } + return body; + } + + private JObject AddVerificationToRecipientBodyTransformation (JObject body) + { + var query = HttpUtility.ParseQueryString(this.Context.Request.RequestUri.Query); + var verificationType = query.Get("verificationType"); + var recipientType = query.Get("recipientType"); + + if (recipientType.Equals("agent") || recipientType.Equals("editor") || recipientType.Equals("inPersonSigner") || recipientType.Equals("participant") || recipientType.Equals("seal") || recipientType.Equals("signer")) + { + recipientType = recipientType + "s"; + } + else if (recipientType.Equals("witness")) + { + recipientType = recipientType + "es"; + } + else + { + recipientType = recipientType.Replace("y", "ies"); + } + + var recipientId = query.Get("recipientId"); + + var recipient = new JObject(); + var recipientArray = new JArray(); + + if (verificationType.Equals("Phone Authentication")) + { + var identityVerification = new JObject(); + var inputOptions = new JArray(); + var inputObject = new JObject(); + var phoneNumberList = new JArray(); + var phoneNumberObject = new JObject(); + + phoneNumberObject["Number"] = body["phoneNumber"]; + phoneNumberObject["CountryCode"] = body["countryCode"]; + phoneNumberList.Add(phoneNumberObject); + + inputObject["phoneNumberList"] = phoneNumberList; + inputObject["name"] = "phone_number_list"; + inputObject["valueType"] = "PhoneNumberList"; + inputOptions.Add(inputObject); + + identityVerification["workflowId"] = body["workflowID"]; + identityVerification["inputOptions"] = inputOptions; + recipient["identityVerification"] = identityVerification; + } + else if (verificationType.Equals("Access Code")) + { + recipient["accessCode"] = body["accessCode"]; + } + else if (verificationType.Equals("Knowledge Based")) + { + recipient["idCheckConfigurationName"] = "ID Check $"; + } + else if (verificationType.Equals("ID Verification")) + { + var identityVerification = new JObject(); + identityVerification["workflowId"] = body["workflowID"]; + recipient["identityVerification"] = identityVerification; + } + + recipient["recipientId"] = recipientId; + recipientArray.Add(recipient); + body[recipientType] = recipientArray; + + var uriBuilder = new UriBuilder(this.Context.Request.RequestUri); + uriBuilder.Path = uriBuilder.Path.Replace("/recipients/addRecipientV2", "/recipients"); + this.Context.Request.RequestUri = uriBuilder.Uri; + + return body; + } + private void AddCoreRecipientParams(JArray signers, JObject body) { var query = HttpUtility.ParseQueryString(this.Context.Request.RequestUri.Query); @@ -855,6 +1103,11 @@ public class Script : ScriptBase signers[0]["routingOrder"] = query.Get("routingOrder"); } + if (!string.IsNullOrEmpty(query.Get("clientUserId"))) + { + signers[0]["clientUserId"] = query.Get("clientUserId"); + } + var emailNotification = new JObject(); var emailNotificationSet = false; @@ -1067,6 +1320,21 @@ public class Script : ScriptBase await this.TransformRequestJsonBody(this.AddRecipientToEnvelopeV2BodyTransformation).ConfigureAwait(false); } + if ("AddVerificationToRecipient".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase)) + { + await this.TransformRequestJsonBody(this.AddVerificationToRecipientBodyTransformation).ConfigureAwait(false); + } + + if ("GenerateEmbeddedSigningURL".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase)) + { + await this.TransformRequestJsonBody(this.GenerateEmbeddedSigningURLBodyTransformation).ConfigureAwait(false); + } + + if ("GenerateEmbeddedSenderURL".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase)) + { + await this.TransformRequestJsonBody(this.GenerateEmbeddedSenderURLBodyTransformation).ConfigureAwait(false); + } + if ("AddDocumentsToEnvelope".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase)) { await this.TransformRequestJsonBody(this.AddDocumentsToEnvelopeBodyTransformation).ConfigureAwait(false); @@ -1163,6 +1431,39 @@ public class Script : ScriptBase body.GetValue("connectId").ToString())); } + if ("GenerateEmbeddedSenderURL".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase)) + { + var query = HttpUtility.ParseQueryString(this.Context.Request.RequestUri.Query); + var openIn = query.Get("openIn"); + + var body = ParseContentAsJObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), false); + var url = body["url"].ToString(); + + if (openIn.Equals("Prepare")) + { + url = url.Replace("&send=" + 1, "&send=" + 0); + } + body["url"] = url; + response.Content = new StringContent(body.ToString(), Encoding.UTF8, "application/json"); + } + + if ("GetWorkflowIds".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase)) + { + var body = ParseContentAsJObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), false); + var workflowsArray = new JArray(); + + foreach (var id in (body["identityVerification"] as JArray)) { + var workflowObj = new JObject() + { + ["type"] = id["workflowId"], + ["name"] = id["defaultName"] + }; + workflowsArray.Add(workflowObj); + } + body["workflowIds"] = workflowsArray; + response.Content = new StringContent(body.ToString(), Encoding.UTF8, "application/json"); + } + if ("GetDynamicSigners".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase)) { var body = ParseContentAsJObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), false);