Skip to content

Commit 911d14c

Browse files
Merge pull request #21 from sriharip-docusign/update_recipient
FLOW-343: Template Prefill - part 1
2 parents 8f37c75 + 2450933 commit 911d14c

File tree

2 files changed

+221
-4
lines changed

2 files changed

+221
-4
lines changed

certified-connectors/DocuSignDemo/apiDefinition.swagger.json

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,6 +1713,215 @@
17131713
"x-ms-no-generic-test": true
17141714
}
17151715
},
1716+
"/accounts/{accountId}/envelopes/{envelopeId}/recipients/updateRecipient": {
1717+
"put": {
1718+
"tags": [
1719+
"DocuSign"
1720+
],
1721+
"summary": "Update envelope recipient",
1722+
"description": "Update envelope recipient.",
1723+
"operationId": "UpdateEnvelopeRecipient",
1724+
"consumes": [
1725+
"application/json",
1726+
"text/json",
1727+
"application/xml",
1728+
"text/xml",
1729+
"application/x-www-form-urlencoded"
1730+
],
1731+
"produces": [
1732+
"application/json",
1733+
"text/json",
1734+
"application/xml",
1735+
"text/xml"
1736+
],
1737+
"parameters": [
1738+
{
1739+
"name": "accountId",
1740+
"in": "path",
1741+
"description": "Account id",
1742+
"required": true,
1743+
"x-ms-summary": "Account",
1744+
"x-ms-dynamic-values": {
1745+
"operationId": "GetLoginAccounts",
1746+
"value-collection": "loginAccounts",
1747+
"value-path": "accountIdGuid",
1748+
"value-title": "name"
1749+
},
1750+
"type": "string"
1751+
},
1752+
{
1753+
"name": "envelopeId",
1754+
"in": "path",
1755+
"description": "Envelope id",
1756+
"required": true,
1757+
"x-ms-summary": "Envelope",
1758+
"type": "string"
1759+
},
1760+
{
1761+
"name": "recipientId",
1762+
"in": "query",
1763+
"description": "Recipient id",
1764+
"required": true,
1765+
"x-ms-summary": "Recipient id",
1766+
"type": "string"
1767+
},
1768+
{
1769+
"name": "recipientType",
1770+
"in": "query",
1771+
"required": true,
1772+
"type": "string",
1773+
"description": "Recipient type",
1774+
"x-ms-summary": "Recipient type",
1775+
"x-ms-dynamic-values": {
1776+
"operationId": "StaticResponseForRecipientTypes",
1777+
"value-collection": "recipientTypes",
1778+
"value-path": "type",
1779+
"value-title": "name"
1780+
}
1781+
},
1782+
{
1783+
"name": "clientUserId",
1784+
"in": "query",
1785+
"description": "Client user ID for embedded signer",
1786+
"required": false,
1787+
"x-ms-summary": "Client User ID",
1788+
"x-ms-visibility": "advanced",
1789+
"type": "string"
1790+
},
1791+
{
1792+
"name": "routingOrder",
1793+
"in": "query",
1794+
"description": "The signing order of the recipient.",
1795+
"x-ms-summary": "Signing order",
1796+
"x-ms-visibility": "advanced",
1797+
"type": "string"
1798+
},
1799+
{
1800+
"name": "emailNotificationLanguage",
1801+
"in": "query",
1802+
"description": "Language for the email notification.",
1803+
"x-ms-summary": "Email notification language",
1804+
"x-ms-visibility": "advanced",
1805+
"type": "string",
1806+
"enum": [
1807+
"Arabic (ar)",
1808+
"Bulgarian (bg)",
1809+
"Czech (cs)",
1810+
"Chinese Simplified (zh_CN)",
1811+
"Chinese Traditional (zh_TW)",
1812+
"Croatian (hr)",
1813+
"Danish (da)",
1814+
"Dutch (nl)",
1815+
"English US (en)",
1816+
"English UK (en_GB)",
1817+
"Estonian (et)",
1818+
"Farsi (fa)",
1819+
"Finnish (fi)",
1820+
"French (fr)",
1821+
"French Canada (fr_CA)",
1822+
"German (de)",
1823+
"Greek (el)",
1824+
"Hebrew (he)",
1825+
"Hindi (hi)",
1826+
"Hungarian (hu)",
1827+
"Bahasa Indonesia (id)",
1828+
"Italian (it)",
1829+
"Japanese (ja)",
1830+
"Korean (ko)",
1831+
"Latvian (lv)",
1832+
"Lithuanian (lt)",
1833+
"Bahasa Malay (ms)",
1834+
"Norwegian (no)",
1835+
"Polish (pl)",
1836+
"Portuguese (pt)",
1837+
"Portuguese Brasil (pt_BR)",
1838+
"Romanian (ro)",
1839+
"Russian (ru)",
1840+
"Serbian (sr)",
1841+
"Slovak (sk)",
1842+
"Slovenian (sl)",
1843+
"Spanish (es)",
1844+
"Spanish Latin America (es_MX)",
1845+
"Swedish (sv)",
1846+
"Thai (th)",
1847+
"Turkish (tr)",
1848+
"Ukranian (uk)",
1849+
"Vietnamese (vi)",
1850+
"Armenian (hy)"
1851+
]
1852+
},
1853+
{
1854+
"name": "emailNotificationSubject",
1855+
"in": "query",
1856+
"description": "Subject of the email notification.",
1857+
"x-ms-summary": "Email notification subject",
1858+
"x-ms-visibility": "advanced",
1859+
"type": "string"
1860+
},
1861+
{
1862+
"name": "emailNotificationBody",
1863+
"in": "query",
1864+
"description": "Body of the email notification.",
1865+
"x-ms-summary": "Email notification body",
1866+
"x-ms-visibility": "advanced",
1867+
"type": "string"
1868+
},
1869+
{
1870+
"name": "note",
1871+
"in": "query",
1872+
"description": "Custom note for the recipient.",
1873+
"x-ms-summary": "Note",
1874+
"x-ms-visibility": "advanced",
1875+
"type": "string"
1876+
},
1877+
{
1878+
"name": "roleName",
1879+
"in": "query",
1880+
"description": "Role name associated with the recipient.",
1881+
"x-ms-summary": "Role name",
1882+
"x-ms-visibility": "advanced",
1883+
"type": "string"
1884+
},
1885+
{
1886+
"name": "countryCode",
1887+
"in": "query",
1888+
"description": "For SMS notifications, the country code, without leading + sign.",
1889+
"x-ms-summary": "SMS Country Code",
1890+
"x-ms-visibility": "advanced",
1891+
"type": "integer"
1892+
},
1893+
{
1894+
"name": "phoneNumber",
1895+
"in": "query",
1896+
"description": " For SMS notifications, the phone number without the country code.",
1897+
"x-ms-summary": "SMS Phone Number",
1898+
"x-ms-visibility": "advanced",
1899+
"type": "integer"
1900+
},
1901+
{
1902+
"name": "additionalRecipientParams",
1903+
"in": "body",
1904+
"description": "Details for selected recipient type.",
1905+
"x-ms-visibility": "advanced",
1906+
"schema": {
1907+
"$ref": "#/definitions/AdditionalRecipientParamsSchema"
1908+
},
1909+
"x-ms-summary": "details for selected recipient type"
1910+
}
1911+
],
1912+
"responses": {
1913+
"201": {
1914+
"description": "OK",
1915+
"schema": {
1916+
"$ref": "#/definitions/Signer"
1917+
}
1918+
}
1919+
},
1920+
"deprecated": false,
1921+
"x-ms-visibility": "important",
1922+
"x-ms-no-generic-test": true
1923+
},
1924+
},
17161925
"/login_information": {
17171926
"get": {
17181927
"tags": [

certified-connectors/DocuSignDemo/script.csx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ public class Script : ScriptBase
10631063

10641064
var uriBuilder = new UriBuilder(this.Context.Request.RequestUri);
10651065
uriBuilder.Path = uriBuilder.Path.Replace("/recipients/addRecipientV2", "/recipients");
1066+
uriBuilder.Path = uriBuilder.Path.Replace("/recipients/updateRecipient", "/recipients");
10661067
this.Context.Request.RequestUri = uriBuilder.Uri;
10671068

10681069
return body;
@@ -1206,8 +1207,15 @@ public class Script : ScriptBase
12061207
{
12071208
var query = HttpUtility.ParseQueryString(this.Context.Request.RequestUri.Query);
12081209

1209-
signers[0]["recipientId"] = GenerateId();
1210-
1210+
if (!string.IsNullOrEmpty(query.Get("recipientId")))
1211+
{
1212+
signers[0]["recipientId"] = query.Get("recipientId");
1213+
}
1214+
else
1215+
{
1216+
signers[0]["recipientId"] = GenerateId();
1217+
}
1218+
12111219
if (!string.IsNullOrEmpty(query.Get("routingOrder")))
12121220
{
12131221
signers[0]["routingOrder"] = query.Get("routingOrder");
@@ -1275,7 +1283,6 @@ public class Script : ScriptBase
12751283
{
12761284
var query = HttpUtility.ParseQueryString(this.Context.Request.RequestUri.Query);
12771285
var recipientType = query.Get("recipientType");
1278-
signers[0]["recipientId"] = GenerateId();
12791286

12801287
if (recipientType.Equals("inPersonSigners"))
12811288
{
@@ -1459,7 +1466,8 @@ public class Script : ScriptBase
14591466
await this.TransformRequestJsonBody(this.AddRecipientToEnvelopeBodyTransformation).ConfigureAwait(false);
14601467
}
14611468

1462-
if ("AddRecipientToEnvelopeV2".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
1469+
if ("AddRecipientToEnvelopeV2".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase) ||
1470+
"UpdateEnvelopeRecipient".Equals(this.Context.OperationId, StringComparison.OrdinalIgnoreCase))
14631471
{
14641472
await this.TransformRequestJsonBody(this.AddRecipientToEnvelopeV2BodyTransformation).ConfigureAwait(false);
14651473
}

0 commit comments

Comments
 (0)