Add verification types, Embedded signing URL, and Embedded sender URL features (#1954)
* FLOW-78: Support for adding recipient type in the add recipient action * add core required param for add recipient - param name : custom fields * Add custom fields to recipient * Support setting core params for all signer types * Support for inperson signer recipient type * Update response to fit schema for in person signer * New schema changs for connec 2.0 json sim * Update model to recognize Connect SIM 2.0 format * add custom fields to the webhook response model * Update webhook response transformation logic for connect 2.0 json sim format * FLOW-133: Support recipient types Agent, CC, Certified Delivery, Editor & Intermediary * Add recipient step has following 2 changes. * Remove custom fields * Update dropdown labels to match with NDSE * FLOW-136: Support witness recipient type * FLOW-84: Create envelope from template expects input for body when no recipients are specified Instead, present the user with option to add recipient name, email * Add dropdown menu for recipient verification * add static response UI verification - phone call * Add static response to phone call option * Add phone call info to body request * Reword the description of AdditionalRecipientData * Add routingOrder to Swagger.json * Remove commented code, and fix description. * Add phone call verification * Add static response for SMS UI * Add SMS verification action * Tag the recipient id field returned by add recipient step "important" , so that it shows in the UI output * Fix Code and Add Phone Call Verification * Change visibility of routingOrder * Add accesscode to function AddParams * Add access code verification * Add knowledge base verification * Add enum for drop down menu * adjust script file to add enum * Fix typo * Fix Typo * Fix typo * In case recipient roles are not specified in the template, request "Email subject" and "Email body" from the user * Fix whitespaces * Add get request * Add dropdown menu for workflow IDs * Add identity verification * Make the connect trigger changes backward compatible using versioning * Keep the previous version of operation id the same for create envelope using template action * Combine the SMS and Phone call verification * Fix typo * Update name for send envelope using template * Add Knowledge base to the branch * Replace async to void * Add client user id to recipient * fix typo * Fix Typo * Add embedded signing UI * Add the URL in the output * Change the clientID to advanced options * Change 'D' to 'd' * Change 'A' to 'a' * Add custom fields to "create envelope using template" FLOW action * Change name to "GenerateEmbeddedSigningURL" * Rename the method * Extract parsing custom fields to a separate method * Use a prefix to differentiate between text custom field and list custom field * FLOW-159: enable user to set label for tabs, in the add recipient tabs step * Change default URL * Add embedded sender action * Add embedded sender response * Add embedded sender url method * Add method to transformRequestBody * Add open in drop down * Add open in tagging or prepare function * Add drop down menu for return URL * Add the return URL * FLOW-180: Version "add recipient to an envelope" action * Remove space in the return url * Change name of return URL * Change return URL name in script file * Change letter to lowercase * Remove duplicated method * FLOW-184: Support adding list custom fields for "create envelope using template" and "create envelope" actions List custom fields shows up as an enum * FLOW-168: list custom fields missing in the connect response * Rename custom fields variable name * Fix merge conflicts * Move the login information code block to where it was * Add verification type action * Add ClientUserId to Recipient Co-authored-by: Srihari Padmanabhan <srihari.padmanabhan@docusign.com> Co-authored-by: Srihari Padmanabhan <90345666+sriharip-docusign@users.noreply.github.com> Co-authored-by: Angel Garcia Reyes <angel.garcia.reyes@docusign.com>
This commit is contained in:
Родитель
f0a49c8f53
Коммит
5a304e21c4
|
@ -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": {
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче