Passing a custom value through DocuSign - docusignapi

We are using DocuSign's .NET Client to send out contracts to customers. We need to pass some meta data with our submission. This is our internal ID for the contract. We use this to trace the envelope when we receive status updates from the connect API. I am aware of the envelope ID but a design decision has been made that we want our own ID too.
I have tried to pass the value using a TextCustomField and setting it in the request, however when we get the status message the custom field is not present. Is it possible to use the custom fields for this purpose or is there a better way to pass meta data?
I'm including the rest trace for our request so that someone can hopefully identify what I need to change so the value is included in the envelope status information.
POST: https://demo.docusign.net/restapi/v2/accounts/111111/envelopes?api_password=true
Headers:
X-DocuSign-Authentication:<DocuSignCredentials><Username>****</Username><Password>****</Password><IntegratorKey>****</IntegratorKey></DocuSignCredentials>
Content-Type:multipart/form-data; boundary=00000000-0000-0000-0000-000000000000
Host:demo.docusign.net
Content-Length:1217301
Expect:100-continue
Connection:Keep-Alive
Request Stream:
--00000000-0000-0000-0000-000000000000
Content-Type: application/json
Content-Disposition: form-data
{
"emailSubject": "Anfrage 2015-06-25T09:10:49: Signieren Sie jetzt Ihren Acme Vertrag",
"status": "sent",
"compositeTemplates": [
{
"compositeTemplateId": "1",
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"email": "mjones#foo.com",
"name": "Max Jones",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"signHereTabs": [
{
"documentId": 1,
"tabLabel": "Signature_LesseeContract1_eSignSignHere",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeSepa1_eSignSignHere",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollect1_eSignSignHere",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeRequest1_eSignSignHere",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollectSepa1_eSignSignHere",
"recipientId": "1"
}
],
"fullNameTabs": [
{
"documentId": 1,
"tabLabel": "Signature_LesseeContract1_eSignFullName",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeSepa1_eSignFullName",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollect1_eSignFullName",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeRequest1_eSignFullName",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollectSepa1_eSignFullName",
"recipientId": "1"
}
],
"textTabs": [
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
}
],
"dateSignedTabs": [
{
"documentId": 1,
"tabLabel": "Signature_LesseeContract1_eSignDateSigned",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeSepa1_eSignDateSigned",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollect1_eSignDateSigned",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeRequest1_eSignDateSigned",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollectSepa1_eSignDateSigned",
"recipientId": "1"
}
]
},
"emailNotification": {
"emailBody": "",
"emailSubject": "Anfrage 2015-06-25T09:10:49: Signieren Sie jetzt Ihren Acme Vertrag",
"supportedLanguage": "de"
}
},
{
"email": "eContractDevelopment#foo.com",
"name": "Any Signer",
"recipientId": "3",
"routingOrder": "3",
"tabs": {
"signHereTabs": [
{
"documentId": 1,
"tabLabel": "Signature_SalesFirstBillAndCollect1_eSignSignHere",
"recipientId": "3"
},
{
"documentId": 1,
"tabLabel": "Signature_SalesFirstContract1_eSignSignHere",
"recipientId": "3"
}
],
"dateSignedTabs": [
{
"documentId": 1,
"tabLabel": "Signature_SalesFirstBillAndCollect1_eSignDateSigned",
"recipientId": "3"
},
{
"documentId": 1,
"tabLabel": "Signature_SalesFirstContract1_eSignDateSigned",
"recipientId": "3"
}
]
},
"emailNotification": {
"emailBody": "",
"emailSubject": "Anfrage 2015-06-25T09:10:49: Signieren Sie jetzt Ihren Acme Vertrag",
"supportedLanguage": "de"
}
},
{
"email": "eContractDevelopment#foo.com",
"name": "Any Signer",
"recipientId": "4",
"routingOrder": "4",
"tabs": {
"signHereTabs": [
{
"documentId": 1,
"tabLabel": "Signature_SalesSecondBillAndCollect1_eSignSignHere",
"recipientId": "4"
},
{
"documentId": 1,
"tabLabel": "Signature_SalesSecondContract1_eSignSignHere",
"recipientId": "4"
}
],
"dateSignedTabs": [
{
"documentId": 1,
"tabLabel": "Signature_SalesSecondBillAndCollect1_eSignDateSigned",
"recipientId": "4"
},
{
"documentId": 1,
"tabLabel": "Signature_SalesSecondContract1_eSignDateSigned",
"recipientId": "4"
}
]
},
"emailNotification": {
"emailBody": "",
"emailSubject": "Anfrage 2015-06-25T09:10:49: Signieren Sie jetzt Ihren Acme Vertrag",
"supportedLanguage": "de"
}
},
{
"email": "mosstest2#foo.com",
"name": "A Reseller",
"recipientId": "2",
"routingOrder": "2",
"tabs": {
"signHereTabs": [
{
"documentId": 1,
"tabLabel": "Signature_ResellerContract1_eSignSignHere",
"recipientId": "2"
}
],
"fullNameTabs": [
{
"documentId": 1,
"tabLabel": "Signature_ResellerContract1_eSignFullName",
"recipientId": "2"
},
{
"documentId": 1,
"tabLabel": "Signature_ResellerBillAndCollect1_eSignFullName",
"recipientId": "2"
}
],
"dateSignedTabs": [
{
"documentId": 1,
"tabLabel": "Signature_ResellerContract1_eSignDateSigned",
"recipientId": "2"
},
{
"documentId": 1,
"tabLabel": "Signature_ResellerBillAndCollect1_eSignDateSigned",
"recipientId": "2"
}
]
},
"emailNotification": {
"emailBody": "",
"emailSubject": "Anfrage 2015-06-25T09:10:49: Signieren Sie jetzt Ihren Acme Vertrag",
"supportedLanguage": "de"
}
}
]
}
}
],
"document": {
"documentId": "1",
"name": "Application.pdf",
"transformPdfFields": "true"
}
}
],
"customFields": {
"textCustomFields": [
{
"name": "EContractID",
"value": "ECID-2015-06-25T09:10:49"
}
]
}
}
--00000000-0000-0000-0000-000000000000
Content-Type: application/pdf
Content-Disposition: file; filename="Application.pdf"; documentId=1; compositeTemplateId="1"
[file bits go here]
--00000000-0000-0000-0000-000000000000--
Response:
{
"envelopeId": "afee6152-23ba-4bcb-a4ad-5b8d8c4dfd7b",
"uri": "/envelopes/afee6152-23ba-4bcb-a4ad-5b8d8c4dfd7b",
"statusDateTime": "2015-06-25T18:12:44.0430000Z",
"status": "sent"
}
POST: https://demo.docusign.net/restapi/v2/accounts/1111111/envelopes/afee6152-23ba-4bcb-a4ad-5b8d8c4dfd7b/views/sender.json?api_password=true
Headers:
Accept:application/json
Content-Type:application/json
X-DocuSign-Authentication:<DocuSignCredentials><Username>****</Username><Password>*****</Password><IntegratorKey>****</IntegratorKey></DocuSignCredentials>
Host:demo.docusign.net
Content-Length:16
Expect:100-continue
Request Stream:
{"ReturnUrl":""}
Response:
{
"url": "https://demo.docusign.net/Member/StartInSession.aspx?StartConsole=1&t=17c4b711-7844-4753-bb2a-fc5251a32deb&DocuEnvelope=afee6152-23ba-4bcb-a4ad-5b8d8c4dfd7b&send=1"
}

Here is a working sample to pass custom field. Looks like your document and custom fields element needs to be inside the inlineTemplate
{
"compositeTemplates": [
{
"inlineTemplates": [
{
"customFields": {
"textCustomFields": [
{
"name": "customEnvId",
"value": "123"
}
]
},
"documents": [
{
"documentId": "1",
"name": "Application.txt"
}
],
"recipients": {
"signers": [
{
"clientUserId": "1",
"email": "mjones#foo.com",
"name": "Max Jones",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"signHereTabs": [
{
"documentId": 1,
"recipientId": "1",
"tabLabel": "Signature_LesseeContract1_eSignSignHere",
"xPosition": "100",
"yPosition": "100"
}
]
}
}
]
},
"sequence": "1"
}
]
}
],
"emailSubject": "Anfrage 2015-06-25T09:10:49: Signieren Sie jetzt Ihren Acme Vertrag",
"status": "sent"
}

Related

How to pre-fill custom fields when creating an envelope?

My business process is like this:
I have one template with one document.
The document must have several fields that must be filled in differently for each signatory.
For example:
fields "company_name", "signer_name", etc.
I assume that when creating an envelope, the fields must be pre-filled for each signer:
Signer 1 should receive values for the fields: "Alice's company", "Alice",
Signer 2 should receive values for the fields: "Bob's company", "Bob".
To do that, I make POST request to endpoint:
/restapi/v2.1/accounts/{accountId}/envelopes
Body:
{
"emailSubject": "Email Subject",
"templateId": "my-template-id",
"status": "sent",
"customFields": {
"textCustomFields": [
{
"fieldId": "10851848897",
"name": "company_name",
"required": "true",
"show": "true",
"value": "Alice's company"
},
{
"fieldId": "10851848898",
"name": "signer_name",
"required": "true",
"show": "true",
"value": "Alice"
}
]
},
"templateRoles": [
{
"email": "alice#maildomain.com",
"emailNotification": {
"emailBody": "email body",
"emailSubject": "email subject",
"supportedLanguage": "en"
},
"roleName": "signer",
"routingOrder": "1"
}
]
}
Alice recieve link to sign the document without pre-filled fields.
Also, GET request to list document's fields
/restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/fields
gives no fields:
{
"documentFields": []
}
Envelope Custom fields can be obtained by a different endpoint:
/restapi/v2.1/accounts/${account_id}/envelopes/${envelope_id}/custom_fields
Now, I assume you actually want something else, which is to show values to the recipients on the envelope.
That is done by actually adding tabs and settings their values like this:
(giving you here a complete example with various different tabs)
ENVELOPE
{
"customFields": {
"textCustomFields": [{
"name": "salary",
"required": "false",
"show": "true",
"value": "123000"
}]
},
"documents": [
{
"documentBase64": "' > $request_data
cat $doc1_base64 >> $request_data
printf '",
"documentId": "1",
"fileExtension": "docx",
"name": "Lorem Ipsum"
}
],
"emailBlurb": "Sample text for email body",
"emailSubject": "Please Sign",
"envelopeIdStamping": "true",
"recipients": {
"signers": [{
"clientUserId": "1000",
"email": "{USER_EMAIL}",
"name": "{USER_NAME}",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"signHereTabs": [{
"anchorString": "/sn1/",
"anchorUnits": "pixels",
"anchorXOffset": "20",
"anchorYOffset": "10"
}],
"textTabs": [{
"anchorString": "/legal/",
"anchorUnits": "pixels",
"anchorXOffset": "5",
"anchorYOffset": "-9",
"bold": "true",
"font": "helvetica",
"fontSize": "size11",
"locked": "false",
"tabId": "legal_name",
"tabLabel": "Legal name",
"value": "{USER_NAME}"
}, {
"anchorString": "/familiar/",
"anchorUnits": "pixels",
"anchorXOffset": "5",
"anchorYOffset": "-9",
"bold": "true",
"font": "helvetica",
"fontSize": "size11",
"locked": "false",
"tabId": "familiar_name",
"tabLabel": "Familiar name",
"value": "{USER_NAME}"
}, {
"anchorString": "/salary/",
"anchorUnits": "pixels",
"anchorXOffset": "5",
"anchorYOffset": "-9",
"bold": "true",
"font": "helvetica",
"fontSize": "size11",
"locked": "true",
"tabId": "salary",
"tabLabel": "Salary",
"value": "$123,000.00"
}]
}
}]
},
"status": "Sent"
}
TEMPLATE
{
"customFields": {
"textCustomFields": [{
"name": "app metadata item",
"required": "false",
"show": "true",
"value": "1234567"
}]
},
"status": "Sent",
"templateId": "'"${template_id}"'",
"templateRoles": [{
"clientUserId": "1000",
"email": "'"${SIGNER_EMAIL}"'",
"name": "'"${SIGNER_NAME}"'",
"roleName": "signer",
"tabs": {
"checkboxTabs": [{
"selected": "true",
"tabLabel": "ckAuthorization"
}, {
"selected": "true",
"tabLabel": "ckAgreement"
}],
"listTabs": [{
"documentId": "1",
"pageNumber": "1",
"tabLabel": "list",
"value": "green"
}],
"radioGroupTabs": [{
"groupName": "radio1",
"radios": [{
"selected": "true",
"value": "white"
}]
}],
"textTabs": [{
"tabLabel": "text",
"value": "Jabberwocky!"
}, {
"bold": "true",
"documentId": "1",
"font": "helvetica",
"fontSize": "size14",
"height": "23",
"locked": "false",
"pageNumber": "1",
"required": "false",
"tabId": "name",
"tabLabel": "added text field",
"value": "'"${SIGNER_NAME}"'",
"width": "84",
"xPosition": "280",
"yPosition": "172"
}]
}
}, {
"email": "'"${CC_EMAIL}"'",
"name": "'"${CC_NAME}"'",
"roleName": "cc"
}]
}

GET Custom_fields in List of Templates DocuSign

I tried to use a GET call in POSTMAN to get the List of Templates and include the Custom Field, but the response does not return the custom_fields value, any thoughts?
GET:
https://demo.docusign.net/restapi/v2/accounts/{account_id}/templates?include=recipients,documents,custom_fields
RESPONSE
{
"templateId": "XXXXXXXXXXXXXXXXXXXXX",
"name": "DEMO",
"shared": "true",
"password": "",
"description": "",
"lastModified": "2017-06-20T14:13:57.9270000Z",
"pageCount": 2,
"uri": "xxxxxxxxxxx",
"folderName": "DEMO",
"folderId": "617c1361-8576-4b62-930e-735442256a25",
"folderUri": "xxxxxxxxx",
"owner": {
"userName": "XXXXXXXXXXXXXXX",
"userId": "XXXXXXXXXXXXXXXXXX",
"email": "XXXXXXXXX#XXXX.COM"
},
"documents": [
{
"documentId": "1",
"uri": "xxxxxxxxxxxx",
"name": "DS_DEMO.pdf",
"order": "1",
"pages": "1",
"display": "inline",
"includeInDownload": "true",
"signerMustAcknowledge": "no_interaction",
"templateLocked": "false",
"templateRequired": "false",
"documentGroup": "content"
},
{
"documentId": "54582351",
"uri": "xxxxxxxxxxxx",
"name": "XXXXXXXXXXXXXX.png",
"order": "2",
"pages": "1",
"display": "inline",
"includeInDownload": "true",
"signerMustAcknowledge": "no_interaction",
"templateLocked": "false",
"templateRequired": "false",
"documentGroup": "content"
}
],
"emailSubject": "Please sign this DS Document",
"emailBlurb": "Thank you for reaching and showing us your interest in how DocuSign works. Please, practice here.\n\n",
"signingLocation": "Online",
"authoritativeCopy": "false",
"enforceSignerVisibility": "false",
"enableWetSign": "false",
"allowMarkup": "true",
"allowReassign": "true",
"recipients": {
"signers": [
{
"defaultRecipient": "false",
"signInEachLocation": "false",
"email": "",
"recipientId": "4",
"accessCode": "",
"requireIdLookup": "false",
"routingOrder": "2",
"note": "",
"roleName": "System Analyst",
"status": "created",
"deliveryMethod": "email",
"templateLocked": "false",
"templateRequired": "false",
"inheritEmailNotificationConfiguration": "false",
"documentVisibility": [
{
"documentId": "1",
"visible": "true"
},
{
"documentId": "54582351",
"visible": "true"
}
]
},
{
"defaultRecipient": "false",
"signInEachLocation": "false",
"name": "DS Training",
"email": "",
"signingGroupId": "10749",
"signingGroupName": "DS Training",
"recipientId": "2",
"accessCode": "",
"requireIdLookup": "false",
"routingOrder": "1",
"note": "Please complete it as soon you can",
"roleName": "Sales Analyst",
"status": "created",
"deliveryMethod": "email",
"templateLocked": "false",
"templateRequired": "false",
"inheritEmailNotificationConfiguration": "false",
"documentVisibility": [
{
"documentId": "1",
"visible": "true"
},
{
"documentId": "54582351",
"visible": "true"
}
]
}
],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [
{
"email": "",
"recipientId": "3",
"accessCode": "",
"requireIdLookup": "false",
"routingOrder": "3",
"note": "",
"roleName": "Manager",
"status": "created",
"templateLocked": "false",
"templateRequired": "false",
"inheritEmailNotificationConfiguration": "false",
"documentVisibility": [
{
"documentId": "1",
"visible": "true"
},
{
"documentId": "54582351",
"visible": "true"
}
]
}
],
"certifiedDeliveries": [],
"inPersonSigners": [],
"recipientCount": "3"
}
},
Reference:
Templates: list documentation
You're right. It is a bug. Thank you for the report. I've verified it and filed DocuSign internal bug report API-7048.
In the meantime, the work-around is to use Templates: get for each of the templates returned by the Templates: list operation.

Propagating entered TextTab value throughout PDF using DocuSign

We are using DocuSign's .NET Client to send out contracts to customers. One of the signer's is responsible for entering a contract number. This number occurs multiple times in the contract and ideally we'd like it to be automatically propagated to each of the fields that have the same name, however if this is not possible the signer could enter it manually in each location.
I have tried adding the TextTab once, and tried adding it multiple times. I've also tried prefixing the label with \* and in every case there is only one TextTab displayed and the value is never propagated.
I'm including the rest trace for our request so that someone can hopefully identify what I need to change so the values appear multiple times or that the TextTab appears multiple times.
POST: https://demo.docusign.net/restapi/v2/accounts/111111/envelopes?api_password=true
Headers:
X-DocuSign-Authentication:<DocuSignCredentials><Username>****</Username><Password>****</Password><IntegratorKey>****</IntegratorKey></DocuSignCredentials>
Content-Type:multipart/form-data; boundary=00000000-0000-0000-0000-000000000000
Host:demo.docusign.net
Content-Length:1217301
Expect:100-continue
Connection:Keep-Alive
Request Stream:
--00000000-0000-0000-0000-000000000000
Content-Type: application/json
Content-Disposition: form-data
{
"emailSubject": "Anfrage 2015-06-25T09:10:49: Signieren Sie jetzt Ihren Acme Vertrag",
"status": "sent",
"compositeTemplates": [
{
"compositeTemplateId": "1",
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"email": "mjones#foo.com",
"name": "Max Jones",
"recipientId": "1",
"routingOrder": "1",
"tabs": {
"signHereTabs": [
{
"documentId": 1,
"tabLabel": "Signature_LesseeContract1_eSignSignHere",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeSepa1_eSignSignHere",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollect1_eSignSignHere",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeRequest1_eSignSignHere",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollectSepa1_eSignSignHere",
"recipientId": "1"
}
],
"fullNameTabs": [
{
"documentId": 1,
"tabLabel": "Signature_LesseeContract1_eSignFullName",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeSepa1_eSignFullName",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollect1_eSignFullName",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeRequest1_eSignFullName",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollectSepa1_eSignFullName",
"recipientId": "1"
}
],
"textTabs": [
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
},
{
"shared": false,
"requireInitialOnSharedChange": false,
"requireAll": false,
"locked": false,
"concealValueOnDocument": false,
"disableAutoSize": false,
"templateLocked": false,
"templateRequired": false,
"documentId": 1,
"tabLabel": "Signature_ContractNumber",
"required": true,
"recipientId": "1"
}
],
"dateSignedTabs": [
{
"documentId": 1,
"tabLabel": "Signature_LesseeContract1_eSignDateSigned",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeSepa1_eSignDateSigned",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollect1_eSignDateSigned",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeRequest1_eSignDateSigned",
"recipientId": "1"
},
{
"documentId": 1,
"tabLabel": "Signature_LesseeBillAndCollectSepa1_eSignDateSigned",
"recipientId": "1"
}
]
},
"emailNotification": {
"emailBody": "",
"emailSubject": "Anfrage 2015-06-25T09:10:49: Signieren Sie jetzt Ihren Acme Vertrag",
"supportedLanguage": "de"
}
},
{
"email": "eContractDevelopment#foo.com",
"name": "Any Signer",
"recipientId": "3",
"routingOrder": "3",
"tabs": {
"signHereTabs": [
{
"documentId": 1,
"tabLabel": "Signature_SalesFirstBillAndCollect1_eSignSignHere",
"recipientId": "3"
},
{
"documentId": 1,
"tabLabel": "Signature_SalesFirstContract1_eSignSignHere",
"recipientId": "3"
}
],
"dateSignedTabs": [
{
"documentId": 1,
"tabLabel": "Signature_SalesFirstBillAndCollect1_eSignDateSigned",
"recipientId": "3"
},
{
"documentId": 1,
"tabLabel": "Signature_SalesFirstContract1_eSignDateSigned",
"recipientId": "3"
}
]
},
"emailNotification": {
"emailBody": "",
"emailSubject": "Anfrage 2015-06-25T09:10:49: Signieren Sie jetzt Ihren Acme Vertrag",
"supportedLanguage": "de"
}
},
{
"email": "eContractDevelopment#foo.com",
"name": "Any Signer",
"recipientId": "4",
"routingOrder": "4",
"tabs": {
"signHereTabs": [
{
"documentId": 1,
"tabLabel": "Signature_SalesSecondBillAndCollect1_eSignSignHere",
"recipientId": "4"
},
{
"documentId": 1,
"tabLabel": "Signature_SalesSecondContract1_eSignSignHere",
"recipientId": "4"
}
],
"dateSignedTabs": [
{
"documentId": 1,
"tabLabel": "Signature_SalesSecondBillAndCollect1_eSignDateSigned",
"recipientId": "4"
},
{
"documentId": 1,
"tabLabel": "Signature_SalesSecondContract1_eSignDateSigned",
"recipientId": "4"
}
]
},
"emailNotification": {
"emailBody": "",
"emailSubject": "Anfrage 2015-06-25T09:10:49: Signieren Sie jetzt Ihren Acme Vertrag",
"supportedLanguage": "de"
}
},
{
"email": "mosstest2#foo.com",
"name": "A Reseller",
"recipientId": "2",
"routingOrder": "2",
"tabs": {
"signHereTabs": [
{
"documentId": 1,
"tabLabel": "Signature_ResellerContract1_eSignSignHere",
"recipientId": "2"
}
],
"fullNameTabs": [
{
"documentId": 1,
"tabLabel": "Signature_ResellerContract1_eSignFullName",
"recipientId": "2"
},
{
"documentId": 1,
"tabLabel": "Signature_ResellerBillAndCollect1_eSignFullName",
"recipientId": "2"
}
],
"dateSignedTabs": [
{
"documentId": 1,
"tabLabel": "Signature_ResellerContract1_eSignDateSigned",
"recipientId": "2"
},
{
"documentId": 1,
"tabLabel": "Signature_ResellerBillAndCollect1_eSignDateSigned",
"recipientId": "2"
}
]
},
"emailNotification": {
"emailBody": "",
"emailSubject": "Anfrage 2015-06-25T09:10:49: Signieren Sie jetzt Ihren Acme Vertrag",
"supportedLanguage": "de"
}
}
]
}
}
],
"document": {
"documentId": "1",
"name": "Application.pdf",
"transformPdfFields": "true"
}
}
],
"customFields": {
"textCustomFields": [
{
"name": "EContractID",
"value": "ECID-2015-06-25T09:10:49"
}
]
}
}
--00000000-0000-0000-0000-000000000000
Content-Type: application/pdf
Content-Disposition: file; filename="Application.pdf"; documentId=1; compositeTemplateId="1"
[file bits go here]
--00000000-0000-0000-0000-000000000000--
Response:
{
"envelopeId": "afee6152-23ba-4bcb-a4ad-5b8d8c4dfd7b",
"uri": "/envelopes/afee6152-23ba-4bcb-a4ad-5b8d8c4dfd7b",
"statusDateTime": "2015-06-25T18:12:44.0430000Z",
"status": "sent"
}
POST: https://demo.docusign.net/restapi/v2/accounts/1111111/envelopes/afee6152-23ba-4bcb-a4ad-5b8d8c4dfd7b/views/sender.json?api_password=true
Headers:
Accept:application/json
Content-Type:application/json
X-DocuSign-Authentication:<DocuSignCredentials><Username>****</Username><Password>*****</Password><IntegratorKey>****</IntegratorKey></DocuSignCredentials>
Host:demo.docusign.net
Content-Length:16
Expect:100-continue
Request Stream:
{"ReturnUrl":""}
Response:
{
"url": "https://demo.docusign.net/Member/StartInSession.aspx?StartConsole=1&t=17c4b711-7844-4753-bb2a-fc5251a32deb&DocuEnvelope=afee6152-23ba-4bcb-a4ad-5b8d8c4dfd7b&send=1"
}
You need two backslashes not just one before the star so instead of \* you need
\\*
Try replacing your JSON with:
"tabLabel": "\\*Signature_LesseeContract1_eSignSignHere",
This is covered in the "Automatically Populating Tabs" page in the REST API Guide, See the Dev Center -> Documentation page for more info.
link

Get tab values from signed_completed document

First of all, DocuSign does not have consistent name for tabs in the document. When you convert PDF into DocuSign template, they were called "fields" which are where you could input your values such as text box, radio button, and check box.
Then in DocuSign admin console, DocuSign lists or labels them as Tags. But in the API document or calls, DocuSign uses another keyword as tab.
My question is how to get all the tab value from a signed document. There is a API call to get tab value from a draft document. It may work for a signed document too. But that API is based on recipient as well.
So if a document has multiple recipients and they all can change one tab. Then once the document is signed by all recipients, how do I get the final tab value from this final document.
The key is there should be only ONE final document regardless how many signers. So I should NOT get the value from each recipient and guess whose input is the final one.
Yes you can make a single API call to get all the tab values and information from a given, completed envelope in addition to draft ones. You need to make a GET request to the URI
v2/accounts/:accountId/envelopes/:envelopeId/recipients
And you need to include the optional query parameter ?include_tabs=true
For instance, your call should look like:
GET https://demo.docusign.net/restapi/v2/accounts/...123456.../envelopes/...ABCDE.../recipients?include_tabs=true
X-DocuSign-Authentication: <DocuSignCredentials><Username>{name}</Username><Password>{password}</Password><IntegratorKey>{integrator_key}</IntegratorKey></DocuSignCredentials>
Accept: application/json
Content-Type: application/json
Sample Response for a completed envelope with 2 recipients:
{
"signers": [
{
"tabs": {
"signHereTabs": [
{
"name": "Signature",
"tabLabel": "Signature 1",
"scaleValue": 1,
"optional": "false",
"documentId": "1386280",
"recipientId": "1822485",
"pageNumber": "1",
"xPosition": "88",
"yPosition": "234",
"tabId": "07e52952-304d-42d3-8ed2-347945e8a5bb"
}
],
"textTabs": [
{
"height": 22,
"isPaymentAmount": "false",
"validationPattern": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"requireAll": "false",
"name": "Text",
"value": "recipient 1 text goes here",
"width": 120,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "DataField1",
"font": "arial",
"bold": "false",
"italic": "false",
"underline": "false",
"fontColor": "black",
"fontSize": "size9",
"documentId": "1386280",
"recipientId": "1822485",
"pageNumber": "1",
"xPosition": "160",
"yPosition": "261",
"tabId": "668c1395-ced9-4b17-8ee9-f495ecbf02cd"
}
],
"checkboxTabs": [
{
"name": "Checkbox",
"tabLabel": "Checkbox 1",
"selected": "true",
"shared": "false",
"requireInitialOnSharedChange": "false",
"required": "true",
"locked": "false",
"documentId": "1386280",
"recipientId": "1822485",
"pageNumber": "1",
"xPosition": "118",
"yPosition": "298",
"tabId": "c767ad9a-9ab9-464d-bf4b-4dbfd811fa98"
}
]
},
"isBulkRecipient": "false",
"name": "John Doe",
"email": "john#test.com",
"recipientId": "1822485",
"recipientIdGuid": "5cb7641f-4009-4341-ab36-7d81074e3456",
"requireIdLookup": "false",
"userId": "346a8395-6a4a-4044-87a4-77586d038bf7",
"routingOrder": "1",
"status": "completed",
"signedDateTime": "2015-03-23T19:39:39.6270000Z",
"deliveredDateTime": "2015-03-23T19:39:14.7770000Z"
},
{
"tabs": {
"signHereTabs": [
{
"name": "Signature",
"tabLabel": "Signature 2",
"scaleValue": 1,
"optional": "false",
"documentId": "1386280",
"recipientId": "1827039",
"pageNumber": "1",
"xPosition": "320",
"yPosition": "234",
"tabId": "dd733be4-6f07-4ab3-bc1f-6b46596e7faa"
}
],
"textTabs": [
{
"height": 22,
"isPaymentAmount": "false",
"validationPattern": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"requireAll": "false",
"name": "Text",
"value": "Sally's text goes here",
"width": 120,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "DataField2",
"font": "arial",
"bold": "false",
"italic": "false",
"underline": "false",
"fontColor": "black",
"fontSize": "size9",
"documentId": "1386280",
"recipientId": "1827039",
"pageNumber": "1",
"xPosition": "445",
"yPosition": "261",
"tabId": "7e435666-255c-4a3c-8699-be71ab6f384b"
}
],
"listTabs": [
{
"listItems": [
{
"text": "foo",
"value": "foo",
"selected": "true"
},
{
"text": "bar",
"value": "bar",
"selected": "false"
}
],
"value": "foo",
"width": 100,
"requireInitialOnSharedChange": "false",
"required": "true",
"locked": "false",
"requireAll": "false",
"tabLabel": "Drop Down 1",
"font": "arial",
"bold": "false",
"italic": "false",
"underline": "false",
"fontColor": "black",
"fontSize": "size9",
"documentId": "1386280",
"recipientId": "1827039",
"pageNumber": "1",
"xPosition": "320",
"yPosition": "301",
"tabId": "b845dde2-ba64-4905-8400-a7b795877ef2"
}
]
},
"isBulkRecipient": "false",
"name": "Sally Doe",
"email": "sally#test.com",
"recipientId": "1827039",
"recipientIdGuid": "43617294-9b97-41c2-8b90-bac4f40a0b33",
"requireIdLookup": "false",
"userId": "346a8395-6a4a-4044-87a4-77586d038bf7",
"routingOrder": "2",
"status": "completed",
"signedDateTime": "2015-03-23T19:40:43.6630000Z",
"deliveredDateTime": "2015-03-23T19:40:20.4070000Z"
}
],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [],
"certifiedDeliveries": [],
"inPersonSigners": [],
"recipientCount": "2",
"currentRoutingOrder": "1"
}
See THIS PAGE of the REST API documentation for more info on the call.

Getting all tabs from a template using REST DocuSign API

I was wondering what the best approach is to get all the tabs from a template using the REST API.
What I am currently trying to do is get all the recipients and all of their tabs so that we can default some of the values as well as lock fields that have populated values when creating the envelope.
To get the recipients I am using /envelopes/{templateId}/recipients.
To get the tabs I would be looping through through all the recipients in the template(s) and then I would be using /envelopes/{templateId}/recipients/{recipientId}/tabs.
I was wondering if this would be the best approach as I would be making as many calls to DocuSign as there are recipients and don't want to make extra calls if there is a better way of doing this.
Thank you.
Actually, there's a simpler way to get all the fields (tabs) for a Template via the REST API. Simply make the following (single) call:
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{templateId}}/recipients?include_tabs=true&include_extended=true
A successful response will contain a collection of the Template's Recipients for each recipient type (i.e., signers, agents, carbonCopies, etc.) -- and each recipient object within any of those collections will include information about the recipient's tabs. For example, here's the response for a Template that contains two Signers -- each 'owning' several tabs of various types:
{
"signers": [
{
"tabs": {
"signHereTabs": [
{
"name": "Sign Here",
"tabLabel": "Signature 1",
"scaleValue": 1,
"optional": "false",
"documentId": "1",
"recipientId": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
"pageNumber": "1",
"xPosition": "74",
"yPosition": "96",
"tabId": "bb7df562-665c-4f8d-8395-56f0c2f6accf"
}
],
"textTabs": [
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "address",
"bold": "false",
"italic": "false",
"underline": "false",
"documentId": "1",
"recipientId": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
"pageNumber": "1",
"xPosition": "74",
"yPosition": "257",
"tabId": "451365aa-f066-45b9-aa58-4d7da60f3039"
}
],
"radioGroupTabs": [
{
"documentId": "1",
"recipientId": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
"groupName": "Radio Group 1",
"radios": [
{
"pageNumber": "1",
"xPosition": "185",
"yPosition": "165",
"value": "Radio 1",
"selected": "false",
"tabId": "25362e61-c421-466b-a13c-934bb3be0ac6",
"required": "True",
"locked": "False"
},
{
"pageNumber": "1",
"xPosition": "214",
"yPosition": "165",
"value": "Radio 2",
"selected": "false",
"tabId": "350f3efa-f2ba-4aaf-bd78-4b45dc475ee4",
"required": "True",
"locked": "False"
}
]
}
],
"listTabs": [
{
"listItems": [
{
"text": "Married",
"value": "M",
"selected": "false"
},
{
"text": "Single",
"value": "S",
"selected": "false"
},
{
"text": "Divorced",
"value": "D",
"selected": "false"
},
{
"text": "Widowed",
"value": "W",
"selected": "false"
}
],
"value": "",
"width": 78,
"shared": "false",
"requireInitialOnSharedChange": "false",
"tabLabel": "MaritalStatus",
"bold": "false",
"italic": "false",
"underline": "false",
"documentId": "1",
"recipientId": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
"pageNumber": "1",
"xPosition": "72",
"yPosition": "213",
"tabId": "b6e5b284-5c87-4a0c-9db5-e4d364ab1113"
}
]
},
"signInEachLocation": "false",
"name": "",
"email": "",
"recipientId": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
"recipientIdGuid": "f1b5d256-d85c-42d3-b081-913fb93e13a7",
"requireIdLookup": "false",
"routingOrder": "1",
"roleName": "Signer1",
"status": "created",
"templateLocked": "false",
"templateRequired": "false"
},
{
"tabs": {
"signHereTabs": [
{
"name": "Sign Here",
"tabLabel": "Signature 8",
"scaleValue": 1,
"optional": "false",
"documentId": "1",
"recipientId": "79e8bc34-6a40-4cc5-90e1-e58d9707418e",
"pageNumber": "1",
"xPosition": "354",
"yPosition": "88",
"tabId": "1e1829ef-005d-4277-b7af-8758cfdf186a"
}
],
"fullNameTabs": [
{
"name": "Full Name",
"tabLabel": "Full Name",
"bold": "false",
"italic": "false",
"underline": "false",
"documentId": "1",
"recipientId": "79e8bc34-6a40-4cc5-90e1-e58d9707418e",
"pageNumber": "1",
"xPosition": "354",
"yPosition": "183",
"tabId": "c33c0f3c-2f77-4985-b5b7-d538220a2f86"
}
],
"textTabs": [
{
"height": 11,
"validationPattern": "",
"validationMessage": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"name": "Text",
"value": "",
"width": 42,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "Data Field 9",
"bold": "false",
"italic": "false",
"underline": "false",
"documentId": "1",
"recipientId": "79e8bc34-6a40-4cc5-90e1-e58d9707418e",
"pageNumber": "1",
"xPosition": "354",
"yPosition": "156",
"tabId": "80e5a803-b1d4-4175-97b4-09c6125f3143"
}
]
},
"signInEachLocation": "false",
"name": "",
"email": "",
"recipientId": "79e8bc34-6a40-4cc5-90e1-e58d9707418e",
"recipientIdGuid": "79e8bc34-6a40-4cc5-90e1-e58d9707418e",
"requireIdLookup": "false",
"routingOrder": "2",
"roleName": "Signer2",
"status": "created",
"templateLocked": "false",
"templateRequired": "false"
}
],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [],
"certifiedDeliveries": [],
"inPersonSigners": [],
"recipientCount": "2"
}

Resources