What is the tabGroups syntax for XML? - docusignapi

I am trying to create a tabGroup for a group of checkboxes so that at least 1 has to be checked, but they keep coming up optional. I referenced Checkbox validation using Docusign REST API for tags needed. I have also searched DocuSign documentation but cannot find syntax or examples for XML.
I have radioGroupTabs set up successfully so I mimicked the tags it uses to see if that would work - it doesn't.
Here is my code for the checkboxes:
<checkboxTabs>
<checkbox>
<documentId>1</documentId>
<recipientId>2</recipientId>
<anchorIgnoreIfNotPresent>True</anchorIgnoreIfNotPresent>
<tabLabel>Race1</tabLabel>
<name>chkRace1</name>
<anchorString>chkRace1</anchorString>
<anchorUnits>pixels</anchorUnits>
<anchorXOffset>-16.7</anchorXOffset>
<anchorYOffset>-3</anchorYOffset>
<selected>False</selected>
<tabGroupLabels>
<string>ChkBxGrpRace</string>
</tabGroupLabels>
</checkbox>
<checkbox>
<documentId>1</documentId>
<recipientId>2</recipientId>
<anchorIgnoreIfNotPresent>True</anchorIgnoreIfNotPresent>
<tabLabel>Race2</tabLabel>
<name>chkRace2</name>
<anchorString>chkRace2</anchorString>
<anchorUnits>pixels</anchorUnits>
<anchorXOffset>-16.7</anchorXOffset>
<anchorYOffset>-3</anchorYOffset>
<selected>False</selected>
<tabGroupLabels>
<string>ChkBxGrpRace</string>
</tabGroupLabels>
</checkbox>
<checkbox>
<documentId>1</documentId>
<recipientId>2</recipientId>
<anchorIgnoreIfNotPresent>True</anchorIgnoreIfNotPresent>
<tabLabel>Race3</tabLabel>
<name>chkRace3</name>
<anchorString>chkRace3</anchorString>
<anchorUnits>pixels</anchorUnits>
<anchorXOffset>-16.7</anchorXOffset>
<anchorYOffset>-3</anchorYOffset>
<selected>False</selected>
<tabGroupLabels>
<string>ChkBxGrpRace</string>
</tabGroupLabels>
</checkbox>
<checkbox>
<documentId>1</documentId>
<recipientId>2</recipientId>
<anchorIgnoreIfNotPresent>True</anchorIgnoreIfNotPresent>
<tabLabel>Race4</tabLabel>
<name>chkRace4</name>
<anchorString>chkRace4</anchorString>
<anchorUnits>pixels</anchorUnits>
<anchorXOffset>-16.7</anchorXOffset>
<anchorYOffset>-3</anchorYOffset>
<selected>False</selected>
<tabGroupLabels>
<string>ChkBxGrpRace</string>
</tabGroupLabels>
</checkbox>
<checkbox>
<documentId>1</documentId>
<recipientId>2</recipientId>
<anchorIgnoreIfNotPresent>True</anchorIgnoreIfNotPresent>
<tabLabel>Race5</tabLabel>
<name>chkRace5</name>
<anchorString>chkRace5</anchorString>
<anchorUnits>pixels</anchorUnits>
<anchorXOffset>-16.7</anchorXOffset>
<anchorYOffset>-3</anchorYOffset>
<selected>False</selected>
<tabGroupLabels>
<string>ChkBxGrpRace</string>
</tabGroupLabels>
</checkbox>
<checkbox>
<documentId>1</documentId>
<recipientId>2</recipientId>
<anchorIgnoreIfNotPresent>True</anchorIgnoreIfNotPresent>
<tabLabel>RaceNA</tabLabel>
<name>chkRaceNA</name>
<anchorString>chkRaceNA</anchorString>
<anchorUnits>pixels</anchorUnits>
<anchorXOffset>-16.7</anchorXOffset>
<anchorYOffset>-3</anchorYOffset>
<selected>False</selected>
<tabGroupLabels>
<string>ChkBxGrpRace</string>
</tabGroupLabels>
</checkbox>
</checkboxTabs>
<tabGroups>
<documentId>1</documentId>
<groupLabel>ChkBxGrpRace</groupLabel>
<groupRule>SelectAtLeast</groupRule>
<maximumAllowed>5</maximumAllowed>
<minimumRequired>1</minimumRequired>
<recipientId>2</recipientId>
<pageNumber>2</pageNumber>
<validationMessage>Please check one or more races, or Prefer not to answer</validationMessage>
</tabGroups>
Any help would be appreciated.

Here's a Live example via the API Request Builder for a group of checkboxes.
You can output the example in different programming languages or JSON.

So, I'll post the JSON for this and you can use https://www.freeformatter.com/json-to-xml-converter.html can help convert to XML :
(note the minimumRequired field that is what you need)
{
"checkboxTabs": [{
"name": "",
"tabLabel": "myTabLbl",
"selected": "false",
"selectedOriginal": "false",
"shared": "false",
"requireInitialOnSharedChange": "false",
"font": "lucidaconsole",
"bold": "false",
"italic": "false",
"underline": "false",
"fontColor": "black",
"fontSize": "size9",
"shareToRecipients": "",
"required": "false",
"locked": "false",
"documentId": "1",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "490",
"yPosition": "69",
"width": "0",
"height": "0",
"tabType": "checkbox",
"trackingId": "c277",
"tabGroupLabels": ["myGroupLbl"]
}, {
"tabLabel": "myTabLbl",
"selected": "false",
"selectedOriginal": "false",
"shared": "false",
"requireInitialOnSharedChange": "false",
"font": "lucidaconsole",
"bold": "false",
"italic": "false",
"underline": "false",
"fontColor": "black",
"fontSize": "size9",
"shareToRecipients": "",
"required": "false",
"locked": "false",
"documentId": "1",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "490",
"yPosition": "85",
"width": "0",
"height": "0",
"tabType": "checkbox",
"trackingId": "c292",
"tabGroupLabels": ["myGroupLbl"]
}, {
"tabLabel": "myTabLbl",
"selected": "false",
"selectedOriginal": "false",
"shared": "false",
"requireInitialOnSharedChange": "false",
"font": "lucidaconsole",
"bold": "false",
"italic": "false",
"underline": "false",
"fontColor": "black",
"fontSize": "size9",
"shareToRecipients": "",
"required": "false",
"locked": "false",
"documentId": "1",
"recipientId": "1",
"pageNumber": "1",
"xPosition": "490",
"yPosition": "101",
"width": "0",
"height": "0",
"tabType": "checkbox",
"trackingId": "c302",
"tabGroupLabels": ["myGroupLbl"]
}]
}
{
"tabGroups": [{
"groupLabel": "myGroupLbl",
"minimumRequired": "1",
"maximumAllowed": "1",
"groupRule": "SelectAtLeast",
"tabScope": "Document",
"documentId": "1",
"recipientId": "1",
"pageNumber": "1",
"width": "0",
"height": "0",
"tabType": "tabgroup"
}]
}

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

Docusign API Date and name tabs don't show

I can successfully create and manage envelopes/documents via the DocuSign API. However, while the SignHere tab works perfectly, the other tabs (fullName, date) won't show. As the 'anchorIgnoreIfNotPresent' flag is set to false, I should get an error message if the anchors were not found, which I don't. The pdf-file looks quite right. The anchors are NOT placed in any form fields. Any ideas?
Thanks a lot, Mario
JSON:
{
"recipients": {
"signers": [{
"email": "info#xyz.com",
"name": "Hans Wurst",
"recipientId": "1",
"tabs": {
"signHereTabs": [{
"anchorString": "*#dssng#*",
"anchorXOffset": "0",
"anchorYOffset": "0",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "pixels"
}],
"fullName": [{
"anchorString": "*#dsname#*",
"anchorXOffset": "0",
"anchorYOffset": "0",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "pixels"
}],
"date": [{
"anchorString": "*#dsdate#*",
"anchorXOffset": "0",
"anchorYOffset": "0",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "pixels"
}]
}
}]
},
"emailSubject": "Neues DocuSign-Dokument zum Unterzeichnen",
"documents": [{
"documentId": "1",
"name": "Contract.pdf",
"documentBase64": "JVBERi0xLjcNJeLjz9n..."
}],
"status": "sent"
}
The issue in your JSON is the the other tab groups should be named in plural like this:
"tabs": {
"signHereTabs": [{
"anchorString": "*#dssng#*",
"anchorXOffset": "0",
"anchorYOffset": "0",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "pixels"
}],
"fullNameTabs": [{
"anchorString": "*#dsname#*",
"anchorXOffset": "0",
"anchorYOffset": "0",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "pixels"
}],
"dateTabs": [{
"anchorString": "*#dsdate#*",
"anchorXOffset": "0",
"anchorYOffset": "0",
"anchorIgnoreIfNotPresent": "false",
"anchorUnits": "pixels"
}]

texttabs not being set using rest api create envelope

Wondering what I am missing or doing wrong here as the value for the tabs are not being set when creating the envelope.
In the JSON code below I am trying to default values for the text tabs for recipient 5.
{
"emailSubject":"Allowance Agreement - AK Anne Klein Footwear - ytd .doc",
"emailBlurb":"DEV - Please complete the Vendor Allowance Agreement required for your Supplier setup with Zappos.com or 6pm.com. \n\n Please reach out to your Vendor Support team member or vendorsupport#zappos.com with any questions.",
"status":"sent",
"compositeTemplates":[
{
"compositeTemplateId": "1",
"inlineTemplates":[
{
"sequence":"1",
"documents": [
{
"documentId": "1",
"name": "Allowance Agreement - AK Anne Klein Footwear - ytd .doc.doc"
}
],
"customFields": {
"textCustomFields": [
{
"name": "Node ID",
"required": "true",
"show": "true",
"value": "658824"
}
]
},
"recipients":{
"signers":[
{
"email":"email#email.com",
"name":"v",
"recipientId":1,
"roleName":"Vendor"
},
{
"email":"email#email.com",
"name":"test",
"recipientId":2,
"roleName":"Vendor Support"
},
{
"email":"email#email.com",
"name":"ap",
"recipientId":3,
"roleName":"AP"
},
{
"email":"email#email.com",
"name":"f",
"recipientId":4,
"roleName":"Finance"
},
{
"email":"email#email.com",
"name":"ap",
"recipientId":5,
"roleName":"AP2",
"tabs":{
"textTabs":[
{
"tabLabel":"txtVendorId",
"value":"100023"
},
{
"tabLabel":"txtSupplierName",
"value":"AK Anne Klein Footwear"
},
{
"tabLabel":"txtSupplierId",
"value":"253"
}
]
}}
]
}
}
],
"serverTemplates":[
{
"sequence":"2",
"templateId":"A3B4F6BB-639A-486F-8C84-826295142F21"
}
]
}
]
}
When I look at the envelope tabs here is what I get for the 5th recipient:
"textTabs": [
{
"height": 22,
"isPaymentAmount": "false",
"validationPattern": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"requireAll": "false",
"name": "Text",
"value": "",
"width": 300,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "txtVendorId",
"font": "lucidaconsole",
"fontColor": "black",
"fontSize": "size9",
"documentId": "1",
"recipientId": "5",
"pageNumber": "2",
"xPosition": "217",
"yPosition": "651",
"tabId": "2179efb5-9f59-4bb7-895e-da868fba9919"
},
{
"height": 22,
"isPaymentAmount": "false",
"validationPattern": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"requireAll": "false",
"name": "Text",
"value": "",
"width": 342,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "txtSupplierName",
"font": "lucidaconsole",
"fontColor": "black",
"fontSize": "size9",
"documentId": "1",
"recipientId": "5",
"pageNumber": "2",
"xPosition": "172",
"yPosition": "670",
"tabId": "2c6e59b1-6a4f-4f5f-a873-33398c78e408"
},
{
"height": 22,
"isPaymentAmount": "false",
"validationPattern": "",
"shared": "false",
"requireInitialOnSharedChange": "false",
"requireAll": "false",
"name": "Text",
"value": "",
"width": 354,
"required": "true",
"locked": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"tabLabel": "txtSupplierId",
"font": "lucidaconsole",
"fontColor": "black",
"fontSize": "size9",
"documentId": "1",
"recipientId": "5",
"pageNumber": "2",
"xPosition": "172",
"yPosition": "690",
"tabId": "614eb20b-5536-45db-b64a-84a475cdc44d"
}
]
* EDIT *
adding final part of envelopes tabs and screen captures of recipients and one tab...
},
"isBulkRecipient": "false",
"name": "ap",
"email": "email#email.com",
"recipientId": "5",
"recipientIdGuid": "77e255d8-a6d6-47a8-98ee-0f3829631d76",
"requireIdLookup": "false",
"userId": "8d7f443b-7adf-4cfa-8368-296aee88e959",
"routingOrder": "5",
"roleName": "AP2",
"status": "created",
"totalTabCount": "5"
}
* Workaround *
Since I was not able to set the tab values at creation time I tried the following:
Tried to create a PUT request to update the tabs using the uri for the tab for the recipient /envelopeid/recipients/5/tabs and passing the JSON for the text tabs as.
{
"textTabs":[
{
"tabLabel": "txtVendorId",
"value":"123"
}
]
}
Passing the JSON above I would get a response that the tab was not found on the envelope
{
"requireAll": "false",
"concealValueOnDocument": "false",
"disableAutoSize": "false",
"recipientId": "5",
"tabId": "00000000-0000-0000-0000-000000000000",
"errorDetails": {
"errorCode": "INVALID_TAB_OPERATION",
"message": "The Tab specified is not valid for the requested operation. The Tab specified is not valid for the requested operation. Tab not found in envelope."
}
My second step was to actually get the tabId value from the created envelope instead of using the tab lable (something that I would not have before creating the envelope).
By calling /envelopeid/recipients/5/tabs with the tabId in the JSON instead like
{
"textTabs":[
{
"tabId": "57135910-fe34-417d-a4e3-fc7d6c4a42ed",
"value":"123"
}
]
}
Then the field value got updated correctly.
In conclusion, for my workaround will need three calls to DocuSign to be able to set the default values for this recipient:
Create Envelope
Get Recipient tabs (to get value of tab ids)
Update tab values using tab ids.
Are you positive you are correctly matching your recipients to valid roles you've configured on the Template?
For instance, I see that for recipient #5 you are assigning them to the "AP2" role, does that exact role exist in your template when you login to the website and view the template?
I'm sorry for the very long delay on an answer, your JSON needs one small tweek.
You need to change your sequence of your serverTemplates to 1, assigning the values to the same template.
"serverTemplates":[
{
"sequence":"1",
}
This will remove the need for the GET/PUT (although you can still do the GET to verify information if you'd like)

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