where is the docusign api tab label wildcard matching documentation - docusignapi

In the api you can select multiple fields with something like this:
Text text = new Text();
text.setTabLabel("\\*_broker");
This will apply settings to all textfields that have names that end with "_broker".
But i want to select ALL text fields in the entire document and "\\*" does not seem to work.
Can anyone tell me how to select all fields from the API, or even better point me to the documentation for the setTabLabel matching format.
I've look all over and it seems alot of the old documentation links no longer work.
Thanks.

You can assign assign all transformed form fields to the first recipient by making them the default recipient (set defaultRecipient to true).
In order to make all of those form fields Collaborative, I believe you'll need to make extra API calls:
First, create the envelope as a draft (status = created instead of sent).
Then make a call to get the list of all the tabs (EnvelopeRecipients::List with include_tabs=true)
Finally, Use the tabLabels (or IDs) in an Envelopes::Update call to add the "shared": "true" parameter to each of them, and update the status to sent to actually send it.

Related

Skip optional TemplateRole in DocuSign envelope

I have a template with two signers. One of them is mandatory but the second one is optional. When I try to create an envelope without a filled second templateRole I receive INVALID_EMAIL_ADDRESS_FOR_RECIPIENT error. Is it possible to conditionally delete templateRole in the envelope with all 'SignHere' tabs?
The recommended way to go about this would be through Conditional Routing.
One of the ways you could go about making this work is to set the optional template role to be conditional based on a specific tab value. Say a text or checkbox. If you were to make these fields read-only and populate them on send, the first recipient would not be able to edit the value.
When our system sees the presence of this value, say a checkbox being checked, it can then follow the logic that you provide to drop the template role.
IE: When sending place a read-only checkbox set to be checked if you want the second recipient to take part.
When the first recipient finishes their portion, Conditional Routing engages. When it sees the checkbox is populated, it knows to send to the second role. If it doesn't see the value populated, that role is then ignored.
Does that make sense? An outline and setup guides for Conditional routing can be found on our support page at https://support.docusign.com/en/guides/ndse-user-guide-conditional-recipients -- the portion for setting this up for an envelope or template in the WebUI is about halfway down the page.
Regards,
Matt
Yes, you can simply not include a role object (template reference pattern) or signer object (composite templates) for the role that you're not interested in. Omitting a role/signer object will remove that recipient, and their tabs, from the envelope.
Here's an example using the API Request Builder
First run the example as is, then try it again but delete a role object.

Docusign API: Searching for a given Envelope/Envelopes using Custom Field

How do we compose a get url to get an envelope or envelopes that contain a given custom field. I tried to compose a get url as one shown below but not getting the desired results (i tried to follow the documentation here -> https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/listStatusChanges but I think i am not passing the custom field to the query string correctly
https://demo.docusign.net/restapi/v2.1/accounts/ACCOUNT_ID_NUMBER/envelopes?from_date=2019-12-05&folder_types=sentitems&status=completed&custom_field=[SignerEmail=john.doe#email.com]
You're using the right API call. Try it without the square brackets and encode the value.
Eg
... &custom_field=SignerEmail%3Djohn.doe%40email.com
The above is untested. If it doesn't work, we'll dig into it further
Important: are you trying to find envelopes that have a custm_envelop_field (metadata) that you created and you named "SignerEmail"?? If so, the the above is the way to go.
If you're looking for envelopes where a signing recipient's email is john#doe.com, try the general search as Inbar suggests. If it doesn't work, you may need another tactic.
Suggest you read here:
https://developers.docusign.com/esign-rest-api/guides/concepts/envelopes/search
the parameter is called search_text and would search everything including custom fields. There's no need to separately specify custom fields.
Something like this:
https://demo.docusign.net/restapi/v2.1/accounts/ACCOUNT_ID_NUMBER/envelopes?search_text=[SignerEmail=john.doe#email.com]

DocuSign: How do I dynamically replace placeholders in our source document?

We are attempting to use the DocuSign API for eSignatures on items such as leases & automatic billing authorizations. What I have are a set of .rtf documents provided to me by our legal team, and there are certain sections that need to be replaced dynamically. I have looked through the DocuSign REST API docs, and I think what we are supposed to be using are text tags. Ware using the PHP SDK. I have not set this document up as a template, as it would be great if we could just use a local file on the filesystem and then have placeholders automatically replaced by values specified in our payload.
What we would like to do is have fields in our documents (such as TenantName and TenantAddress) that we can assign values to, and have DocuSign dynamically replace these placeholders with the values we specify. I have tried doing this using Text Tabs, but the values are not being replaced. Here is a code sample:
$document = new Document([
'document_base64' => $b64fc, // base64_encoded value of file_get_contents('path/to/document.pdf')
'name' => 'Autobill Form',
'file_extension' => 'pdf',
'document_id' => '1',
]);
$tag1 = new Text();
$tag1->setTabLabel('TenantName');
$tag1->setValue('Joe Signer');
$tag1->setLocked(true);
$tag1->setDocumentId('1');
$tag1->setPageNumber('1');
$tag2 = new Text();
$tag2->setTabLabel('TenantAddress');
$tag2->setValue('123 Main St.');
$tag2->setLocked(true);
$tag2->setDocumentId('1');
$tag2->setPageNumber('1');
$tabs = new Tabs();
$tabs->setTextTabs([$tag1, $tag2]);
$document->setTabs($tabs);
// other code to set up recipients, envelopes, and get an embedded signing url
When I view the document, these fields are not replaced, and still have their placeholder values. I don't want to use anchors as I need the placeholder to be removed and replaced by DocuSign. I have also tried setting the text tabs on the Signer object, but that did not work either.
What am I doing wrong? This seems like it would be a fairly common use case for the DocuSign API, but I haven't been able to figure this out.
As Inbar states, the DocuSign eSignature API doesn't allow you to modify the underlying document. You'd need to external tooling to prepare the document prior to passing it into the API Call.
That said, one possible option would be to have blank spaces in your document that align with Text tabs. If you pre-populate those tags and set them to be read-only, the placeholders tags will burn-in during the signing session. Spacing, alignment, and font likely won't be perfect, but with some adjustment you can do okay.

Getting an error in docusign api explorer

I'm trying to populate the textTabs in one of the documents so that it has information prefilled into it using the call for EnvelopeTabs: update, however it keeps throwing me an error that it cannot find the tab that I am trying to test in the explorer. I have used the list call in the EnvelopeTabs to make sure that the information that I'm providing matches what is in the envelope and it is, here's an example of what I was seeing
enter image description here
enter image description here
When I make the call to update the tab in textTabs, I am doing it with the documentId, pageNumber, and tabLabel provided above and with the value set to what I want to be prefilled, however I keep getting an error that it cannot find the specified tab.
I have even tried filling it in with just the tabId and am still getting the same error.
In an effort to see if I was missing something, I also tried checking the linked reference documentation on the EnvelopeTabs: update page but it is 404ing (as were one or two other end points in the api explorer).
Any help would be appreciated as it seems like there is a piece of information that I'm missing to prefill tabs.
Are you creating the envelope via the API? If so, then the easy way to set a tab's value is to set the value parameter.
If you want to set a tab's value after the envelope is created, use the EnvelopeRecipientTabs: update method. (Note the resource name in your question was incorrect.)
When using this method, or any other DocuSign update method, remember that it is not a patch method: You must supply all of the parameters for the Envelope Recipient Tab that you're updating. If you don't already have all of the settings, then first do a get on the object, then update it.
I tried using below JSON call to update the Recipient tab and its updating the tab value:
PUT /restapi/v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs
{
"textTabs": [
{
"value":"newVal",
"tabId": "cef562dd-e098-4dcd-935d-34ff8f5b5211"
}
]
}

Docusign API, "Correct Document" or just change fields

Using the Docusign API, I am trying to change the fields that exist on a document. When I first create the document, I am able to change field values using "tabs." I get how to do that.
When I am trying to edit, or in Docusign's terms "correct," a document after it has been sent out, but before being signed, I am having trouble figuring out how to access those fields again to change the values.
I have tried using the API avenue described here ( PUT /v2/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/fields ), but even after successful calls, the values of the fields aren't changing, and I believe it is because I should be trying to access the tabs, as I did when first changing the tab values as I created the document, instead of targeting the fields, since the two seem to be different. Any thoughts? Thank you in advance for your answers.
To update Tab values you should use the putRecipientTabs api.
Once a signer completes the Signing process, the tab values cannot be updated.
Also not all Tab values can be updated. See this answer for more information.
The putEnvelopeDocumentFields api is for a different purpose. Document fields are different from Tabs. Document fields are an array of name-value custom data strings to be added to a document. Custom document field information is returned in the status, but otherwise is not used by DocuSign.
I figured it out.
The "fields" we are seeing on documents are "tabs," and they are children of the recipients.
The hierarchy goes envelope > recipients > tabs, which tabs we were trying to change. Not envelope > document > fields, which refers to something else--just familiarizing with the language of the api.
Here is a link to the reference for how to change "fields" aka "tabs", and that link includes sample requests.
One thing that helped me target my actual fields, since I kept on getting an error that the field didn't exist for the recipient, is to do a get request of all available tabs and use that response body as the request body for the update call (where we change the field values). Then you know the field information will be accurate, paring the body down to exactly the "fields" aka "tabs" you are interested in targeting.

Resources