Skip to content

Commit 6da85a9

Browse files
Merge pull request #13 from sriharip-docusign/dev
Push changes from my local branch to release branch
2 parents 0bbfecc + fcc2eda commit 6da85a9

File tree

2 files changed

+50
-20
lines changed

2 files changed

+50
-20
lines changed

certified-connectors/DocuSignDemo/apiDefinition.swagger.json

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,12 @@
387387
"type": "string"
388388
},
389389
{
390-
"name": "documentId",
390+
"name": "documentGuid",
391391
"in": "query",
392-
"description": "Document Id",
392+
"description": "Document Guid",
393393
"required": true,
394-
"x-ms-summary": "Document Id",
395-
"x-ms-test-value": "insert document id guid",
394+
"x-ms-summary": "Document Guid",
395+
"x-ms-test-value": "insert document guid",
396396
"type": "string"
397397
},
398398
{
@@ -998,14 +998,12 @@
998998
"consumes": [
999999
"application/json",
10001000
"text/json",
1001-
"application/xml",
10021001
"text/xml",
10031002
"application/x-www-form-urlencoded"
10041003
],
10051004
"produces": [
10061005
"application/json",
10071006
"text/json",
1008-
"application/xml",
10091007
"text/xml"
10101008
],
10111009
"parameters": [
@@ -1029,9 +1027,20 @@
10291027
"in": "query",
10301028
"description": "Template id",
10311029
"required": true,
1032-
"x-ms-summary": "Template id",
1030+
"x-ms-summary": "Template",
10331031
"x-ms-test-value": "insert template id",
10341032
"x-ms-visibility": "important",
1033+
"x-ms-dynamic-values": {
1034+
"operationId": "GetEnvelopeTemplates",
1035+
"parameters": {
1036+
"accountId": {
1037+
"parameter": "accountId"
1038+
}
1039+
},
1040+
"value-collection": "envelopeTemplates",
1041+
"value-path": "templateId",
1042+
"value-title": "name"
1043+
},
10351044
"type": "string"
10361045
},
10371046
{
@@ -3058,9 +3067,9 @@
30583067
},
30593068
"/accounts/{accountId}/envelopes/{envelopeId}/get_document_id": {
30603069
"get": {
3061-
"summary": "Get document id",
3062-
"description": "Get document id",
3063-
"operationId": "GetDocumentId",
3070+
"summary": "Get envelope document id",
3071+
"description": "Get envelope document id",
3072+
"operationId": "GetEnvelopeDocumentId",
30643073
"parameters": [
30653074
{
30663075
"name": "accountId",
@@ -4508,6 +4517,12 @@
45084517
"x-ms-summary": "Envelope Id",
45094518
"x-ms-visibility": "important"
45104519
},
4520+
"templateId": {
4521+
"description": "The id of the template.",
4522+
"type": "string",
4523+
"x-ms-summary": "Template Id",
4524+
"x-ms-visibility": "important"
4525+
},
45114526
"status": {
45124527
"description": "The status of the envelope.",
45134528
"type": "string",
@@ -5100,17 +5115,20 @@
51005115
"EnvelopeDocument": {
51015116
"type": "object",
51025117
"properties": {
5118+
"name": {
5119+
"description": "The name of the document.",
5120+
"type": "string",
5121+
"x-ms-summary": "Name"
5122+
},
51035123
"documentId": {
51045124
"description": "The id of the document.",
51055125
"type": "string",
5106-
"x-ms-summary": "Document Id",
5107-
"x-ms-visibility": "important"
5126+
"x-ms-summary": "Document Id"
51085127
},
5109-
"name": {
5110-
"description": "The name of the document.",
5128+
"documentIdGuid": {
5129+
"description": "The guid of the document.",
51115130
"type": "string",
5112-
"x-ms-summary": "Name",
5113-
"x-ms-visibility": "important"
5131+
"x-ms-summary": "Document Guid"
51145132
}
51155133
}
51165134
},

certified-connectors/DocuSignDemo/script.csx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,7 +1475,7 @@ public class Script : ScriptBase
14751475
var body = ParseContentAsJArray(await this.Context.Request.Content.ReadAsStringAsync().ConfigureAwait(false), true);
14761476
var query = HttpUtility.ParseQueryString(this.Context.Request.RequestUri.Query);
14771477
var fieldList = new JArray();
1478-
var documentId = query.Get("documentId");
1478+
var documentId = query.Get("documentGuid");
14791479

14801480
foreach (var field in body)
14811481
{
@@ -1752,7 +1752,7 @@ public class Script : ScriptBase
17521752
this.Context.Request.RequestUri = uriBuilder.Uri;
17531753
}
17541754

1755-
if ("GetDocumentId".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
1755+
if ("GetEnvelopeDocumentId".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
17561756
{
17571757
var uriBuilder = new UriBuilder(this.Context.Request.RequestUri);
17581758
uriBuilder.Path = uriBuilder.Path.Replace("/get_document_id", "/documents");
@@ -2392,7 +2392,7 @@ public class Script : ScriptBase
23922392
response.Content = new StringContent(newBody.ToString(), Encoding.UTF8, "application/json");
23932393
}
23942394

2395-
if ("GetDocumentId".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
2395+
if ("GetEnvelopeDocumentId".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
23962396
{
23972397
var body = ParseContentAsJObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), false);
23982398
var query = HttpUtility.ParseQueryString(this.Context.Request.RequestUri.Query);
@@ -2403,7 +2403,8 @@ public class Script : ScriptBase
24032403
{
24042404
if (documentName.Equals(documentInfo["name"].ToString()))
24052405
{
2406-
newBody["documentId"] = documentInfo["documentIdGuid"];
2406+
newBody["documentId"] = documentInfo["documentId"];
2407+
newBody["documentIdGuid"] = documentInfo["documentIdGuid"];
24072408
newBody["name"] = documentInfo["name"];
24082409
break;
24092410
}
@@ -2417,6 +2418,17 @@ public class Script : ScriptBase
24172418
response.Content = new StringContent(newBody.ToString(), Encoding.UTF8, "application/json");
24182419
}
24192420

2421+
if ("CreateEnvelopeFromTemplateNoRecipients".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase) ||
2422+
"SendEnvelope".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
2423+
{
2424+
var body = ParseContentAsJObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), false);
2425+
var query = HttpUtility.ParseQueryString(this.Context.Request.RequestUri.Query);
2426+
var templateId = query.Get("templateId");
2427+
body["templateId"] = templateId;
2428+
2429+
response.Content = new StringContent(body.ToString(), Encoding.UTF8, "application/json");
2430+
}
2431+
24202432
if (response.Content?.Headers?.ContentType != null)
24212433
{
24222434
if ("GetDocuments".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))

0 commit comments

Comments
 (0)