Skip to content

Commit 40f7427

Browse files
Merge pull request #6 from harshitav-docusign/dev
Moving GetTemplateDocumentTabs from Harshita-Dev to C2 branch
2 parents 1edf48d + 70c5b4e commit 40f7427

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

certified-connectors/DocuSignDemo/apiDefinition.swagger.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,58 @@
397397
"x-ms-visibility": "advanced"
398398
}
399399
},
400+
"/accounts/{accountId}/templates/{templateId}/documents/{documentId}/tabs": {
401+
"get": {
402+
"summary": "Get template document tabs",
403+
"description": "Get template document tabs.",
404+
"operationId": "GetTemplateDocumentTabs",
405+
"parameters": [
406+
{
407+
"name": "accountId",
408+
"in": "path",
409+
"description": "Account id",
410+
"required": true,
411+
"x-ms-summary": "Account",
412+
"x-ms-test-value": "insert account id",
413+
"x-ms-dynamic-values": {
414+
"operationId": "GetLoginAccounts",
415+
"value-collection": "loginAccounts",
416+
"value-path": "accountIdGuid",
417+
"value-title": "name"
418+
},
419+
"type": "string"
420+
},
421+
{
422+
"name": "templateId",
423+
"in": "path",
424+
"description": "Template id",
425+
"required": true,
426+
"x-ms-summary": "Template",
427+
"x-ms-test-value": "insert template id",
428+
"type": "string"
429+
},
430+
{
431+
"name": "documentId",
432+
"in": "path",
433+
"description": "Document id",
434+
"required": true,
435+
"x-ms-summary": "Document id",
436+
"x-ms-test-value": "insert document id",
437+
"type": "string"
438+
}
439+
],
440+
"responses": {
441+
"200": {
442+
"description": "default",
443+
"schema": {
444+
"$ref": "#/definitions/ListTabsResponse"
445+
}
446+
}
447+
},
448+
"deprecated": false,
449+
"x-ms-visibility": "advanced"
450+
}
451+
},
400452
"/trigger/accounts/{accountId}/envelopes": {
401453
"get": {
402454
"tags": [

certified-connectors/DocuSignDemo/script.csx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,6 +1726,34 @@ public class Script : ScriptBase
17261726
response.Content = new StringContent(newBody.ToString(), Encoding.UTF8, "application/json");
17271727
}
17281728

1729+
if ("GetTemplateDocumentTabs".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
1730+
{
1731+
var body = ParseContentAsJObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), false);
1732+
var newBody = new JObject();
1733+
JArray tabs = new JArray();
1734+
1735+
foreach(JProperty tabTypes in body.Properties())
1736+
{
1737+
foreach(var tab in tabTypes.Value)
1738+
{
1739+
tabs.Add(new JObject()
1740+
{
1741+
["name"] = tab["name"],
1742+
["tabLabel"] = tab["tabLabel"],
1743+
["value"] = tab["value"],
1744+
["documentId"] = tab["documentId"],
1745+
["tabId"] = tab["tabId"],
1746+
["tabType"] = tab["tabType"],
1747+
["recipientId"] = tab["recipientId"]
1748+
});
1749+
}
1750+
}
1751+
1752+
newBody["tabs"] = tabs;
1753+
1754+
response.Content = new StringContent(newBody.ToString(), Encoding.UTF8, "application/json");
1755+
}
1756+
17291757
if ("GetTabInfo".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
17301758
{
17311759
var body = ParseContentAsJObject(await response.Content.ReadAsStringAsync().ConfigureAwait(false), false);

0 commit comments

Comments
 (0)