GET Custom_fields in List of Templates DocuSign - docusignapi

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.

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"
}]
}

How to create an envelope with signingGroup recipient?

I am creating an envelope using this uri:
POST https://demo.docusign.net/restapi/v2.1/accounts/{accountId}/envelopes
headers:
Content-Type : application/json
X-DocuSign-Authentication: {"Username" : *****, "Password" : ******, "IntegratorKey" : *********}
body:
{
"status": "sent",
"emailSubject": "Signing Request for Doc2.docx",
"signerCanSignOnMobile": "true",
"documents": [
{
"documentId": "384098342",
"name": "Doc2.docx",
"fileExtension": "docx",
"documentBase64": *****,
"tabs": {
"textTabs": [
{
"xPosition": "2",
"yPosition": "3",
"documentId": "384098342",
"pageNumber": "1",
"value": "Fill in name.",
"locked": "false",
"anchorString": "sign5",
"anchorXOffset": "1.75",
"anchorYOffset": "0",
"anchorUnits": "inches",
"anchorIgnoreIfNotPresent": "true"
}
]
}
}
],
"recipients": {
"signers": [
{
"name": "Tom Ford",
"email": "tom.ford#email.com",
"recipientId": "64000",
"clientUserId": "c7052b97-f9a7-4af4-85de-8c64371467b1"
},
{
"name": "Demand Approvers",
"email": "approvers#email.com",
"signingGroupId": "true",
"signingGroupName": "Demand Approvers",
"recipientId": "626000",
"clientUserId": "123c6d15-1d25-4595-9878-5cbda4ba2823",
"signingGroupUsers": [
{
"userName": "John Smith",
"userId": "9c328221-1e86-41db-a3e7-bde9b4b4a50d",
"email": "josmith#example.com"
}
]
}
]
}
}
and the request succeeds. However, when I try to query the returned envelope, the "Demand Approvers" is listed as a single recipient instead of as a signingGroup.
Here is an example output:
{
"status": "sent",
"documentsUri": "/envelopes/063454a6-dee6-4e86-8d38-56d85e66c61e/documents",
"recipientsUri": "/envelopes/063454a6-dee6-4e86-8d38-56d85e66c61e/recipients",
"attachmentsUri": "/envelopes/063454a6-dee6-4e86-8d38-56d85e66c61e/attachments",
"envelopeUri": "/envelopes/063454a6-dee6-4e86-8d38-56d85e66c61e",
"emailSubject": "Signing Request for Doc2.docx",
"envelopeId": "063454a6-dee6-4e86-8d38-56d85e66c61e",
"signingLocation": "online",
"customFieldsUri": "/envelopes/063454a6-dee6-4e86-8d38-56d85e66c61e/custom_fields",
"notificationUri": "/envelopes/063454a6-dee6-4e86-8d38-56d85e66c61e/notification",
"enableWetSign": "true",
"allowMarkup": "false",
"allowReassign": "true",
"createdDateTime": "2021-02-17T00:43:28.7070000Z",
"lastModifiedDateTime": "2021-02-17T00:43:28.7230000Z",
"initialSentDateTime": "2021-02-17T00:43:29.2570000Z",
"sentDateTime": "2021-02-17T00:43:29.2570000Z",
"statusChangedDateTime": "2021-02-17T00:43:29.2570000Z",
"documentsCombinedUri": "/envelopes/********************/documents/combined",
"certificateUri": "/envelopes/********************/documents/certificate",
"templatesUri": "/envelopes/********************/templates",
"expireEnabled": "true",
"expireDateTime": "2021-06-17T00:43:29.2570000Z",
"expireAfter": "120",
"sender": {
"userName": "********",
"userId": "********",
"accountId": "********",
"email": "sender#email.com"
},
"recipients": {
"signers": [
{
"creationReason": "sender",
"isBulkRecipient": "false",
"recipientSuppliesTabs": "true",
"requireUploadSignature": "false",
"name": "Demand Approvers",
"firstName": "",
"lastName": "",
"email": "approvers#email.com",
"recipientId": "626000",
"recipientIdGuid": "365b2f4d-0968-42d1-805e-55eece700246",
"requireIdLookup": "false",
"userId": "891a3891-f49d-4f14-8bc8-959524e2445a",
"clientUserId": "123c6d15-1d25-4595-9878-5cbda4ba2823",
"routingOrder": "1",
"status": "sent",
"completedCount": "0",
"deliveryMethod": "email",
"recipientType": "signer"
},
{
"creationReason": "sender",
"isBulkRecipient": "false",
"recipientSuppliesTabs": "true",
"requireUploadSignature": "false",
"name": "Tom Ford",
"firstName": "",
"lastName": "",
"email": "tom.ford#email.com",
"recipientId": "64000",
"recipientIdGuid": "c60c5ccd-e49f-4b63-9745-5f283b8520eb",
"requireIdLookup": "false",
"userId": "4a78d305-43bf-4d78-a844-2bdc15e63770",
"clientUserId": "c7052b97-f9a7-4af4-85de-8c64371467b1",
"routingOrder": "1",
"status": "sent",
"completedCount": "0",
"deliveryMethod": "email",
"recipientType": "signer"
}
],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [],
"certifiedDeliveries": [],
"inPersonSigners": [],
"seals": [],
"witnesses": [],
"notaries": [],
"recipientCount": "2",
"currentRoutingOrder": "1"
},
"purgeState": "unpurged",
"envelopeIdStamping": "true",
"is21CFRPart11": "false",
"signerCanSignOnMobile": "true",
"autoNavigation": "true",
"isSignatureProviderEnvelope": "false",
"hasFormDataChanged": "false",
"allowComments": "true",
"hasComments": "false",
"allowViewHistory": "true",
"envelopeMetadata": {
"allowAdvancedCorrect": "true",
"enableSignWithNotary": "true",
"allowCorrect": "true"
},
"anySigner": null,
"envelopeLocation": "current_site",
"isDynamicEnvelope": "false"
}
The signingGroup related information for Demand Approvers is missing.
How do I structure my request so that the Demand Approvers will be listed as a signingGroup?
I found the cause. So it seems that when dealing with Signing Groups,
These 2 points must be true:
The Signing Group must be registered in DocuSign. The generated
signingGroupId can then be used as recipient. Setting signingGroupId
to "true" or any random value will not work.
clientUserId must not be provided

Passing a custom value through DocuSign

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"
}

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