Is there a way to send an envelope using the eWitness feature? - docusignapi

I'm currently working on a document signing and management app that uses the Docusign API to handle the signing of the documents. The documents need to allow for a witness to sign, but we don't necessarily know who will be acting as the witness at the time of sending the envelope. The app would need to ask the signer(s) who will be witnessing at the time of signing.
After some digging, I found Docusign's eWitness feature which does exactly what we need our app to do. However, I couldn't find anything in the API documentation that describes how to use this feature.
Ideally, I'd like to use the API to create and send an envelope from a template using the eWitness feature.
Any help is greatly appreciated!

Yes!
The EnvelopeRecipients object has a new attribute of witnesses Docs for both. witnesses is an array of witness objects.
When sending the envelope via the API:
Create the signer recipient object. Remember the recipientId you're using.
Create a witness recipient object with two attributes: recipientId (a new value), and witnessFor, set to the recipientId of the signer.
Create a SignHere tab for the signer recipient and the witness recipient.
Send the envelope.
When the signer signs, they will be asked to provide the name and email of the witness to their signature.
After the signer signs, the witness receives an email that enables them to sign the document as the witness.
The signer recipient can be an embedded signer or a "remote" signer and receive their invitation to sign via email.
You may be able to set the witness' name/email when you create the envelope, but I have not tested that. You may also be able to set the witness' clientUserId so you can give them an embedded signing experience but I haven't tested that either. (Please let us know if you test either of these flows.)
Using a template with recipient who has a witness
To use a template with a recipient who has a witness, just create the template with a role that has a witness enabled. Then when sending the envelope use the template and include a role definition for the signer recipient (their name/email).
JSON example
Here is the working JSON for an embedded signing recipient with a witness. The signer enters the witness' name/email into the embedded signing ceremony.
"envelopeDefinition": {
"emailSubject": "Please sign the attached document",
"status": "sent",
"documents": [
{
"name": "Example document",
"fileExtension": "pdf",
"documentId": "1"
}
],
"recipients": {
"signers": [
{
"email": "signer_email#example.com",
"name": "Signer's name",
"recipientId": "1",
"clientUserId": "1000",
"tabs": {
"signHereTabs": [
{
"anchorString": "/sig1/",
"anchorXOffset": "20",
"anchorUnits": "pixels"
}
]
}
}
],
"witnesses": [
{
"recipientId": "2",
"witnessFor": "1",
"tabs": {
"signHereTabs": [
{
"anchorString": "/sig1/",
"anchorXOffset": "200",
"anchorUnits": "pixels"
}
]
}
}
]
}

Related

Docuisgn Embedded signing plus email

We have a requirement that we want to send DocuSign email to recipient who is marked as Captive /embedded. By default DocuSign will not send email to embedded signers. In case the recipient doesn't want to sign at our web site, they can open envelope later from their email. Is there some setting like that or some setting in Rest API call?
Found Answer at Here.
If sender sets embeddedRecipientStartURL to SIGN_AT_DOCUSIGN for particular recipient, the recipient is directed to an embedded signing or viewing process directly hosted at DocuSign.
In effect, this causes the recipient to be both embedded and receive an official "please sign" email from DocuSign.
Sample Json
{
"compositeTemplates": [{
"inlineTemplates": [{
"recipients": {
"signers": [{
"tabs": {
"fullNameTabs": [{
"fontColor": "white",
"pageNumber": 1,
"documentId": "1",
"xPosition": 400,
"yPosition": 15
}]
},
"name": "Full Name",
"email": "signersemail#email.com",
"recipientId": "1",
"clientUserId": "1000",
"embeddedRecipientStartURL": "SIGN_AT_DOCUSIGN"
}]
},
"sequence": "1"
}],
"document": {
"documentBase64": "<Base64Bytes>",
"documentId": "1",
"fileExtension": "pdf",
"name": "Doc.pdf"
}
}],
"status": "sent",
"emailBlurb": "Test Body",
"emailSubject": "Test Subject"
}
There are multiple ways to do that, depending on the exact use-case.
It seems that you want to first do embedded signing (which I assume you know how to do) and then if the user select something in your app - you want to send an email for the same exact recipient to sign the same exact envelope. So you have to make an additional API call at that point to update the recipient to remote and re-send the envelope.
That can be done using a PUT call to update the envelope. You have to add ?resend_envelope=true to that call

How to get embedded signing URL for signers who are assigned by agents/intermediaries in DocuSign?

When using agents/intermediaries to assign signers in DocuSign, we set the clientUserId for the signers to use the embedded signing feature. But DocuSign will automatically send out the email to the assigned signers and we are not able to obtain the signing URL through the API POST {{baseUrl}}/v2.1/accounts/{{accountId}}/envelopes/{{envelopeId}}/views/recipient.
As suggested in this thread: https://stackoverflow.com/a/63810135/13191875 . It's due to the clientUserId was removed when agents/intermediaries change the signer's email/name info. It suggests that a workflow could be added to pause the process after the signer's email/name info is changed, and then add the clientUserId to the signer, then resume the workflow.
I tried with request body:
{
"recipients": {
"intermediaries": [
{
"clientUserId": "1",
"email": "aaa#example.com.au",
"name": "Intermediary",
"recipientId": "1",
"routingOrder": "1"
}
],
"signers": [
{
"clientUserId": "2",
"email": "example#example.com",
"name": "example",
"recipientId": "2",
"routingOrder": "2",
"tabs": {
"signHereTabs": [
{
"anchorIgnoreIfNotPresent": "false",
"anchorString": "Signature_anchor_1",
"anchorUnits": "pixels",
"anchorYOffset": "0",
"name": "Please sign here",
"recipientId": "1"
}
]
}
}
]
},
"workflow": {
"workflowSteps": [
{
"action": "pause_before",
"itemId": "2",
"triggerOnItem": "routing_order"
}
]
},
"emailSubject": "DocuSign API - Signature Request on Document Call",
"documents": [
{
"documentId": "1",
"name": "{{fileName}}",
"documentBase64": "{{fileBase64}}"
}
],
"status": "sent"
}
I can set the clientUserId after the signer's email/name is changed. But the workflow cannot be resumed by calling the API PUT {{baseUrl}}/v2.1/accounts/{{accountId}}/envelopes/{{envelopeId}}?resend_envelope=true. So the signer's signing URL cannot be obtained since the process is paused, the signer's status stays in created.
I also tried the with agents:
{
"recipients": {
"agents": [
{
"clientUserId": "1",
"email": "aaa#example.com.au",
"name": "Agent",
"recipientId": "1",
"routingOrder": "1"
}
],
"signers": [
{
"clientUserId": "2",
"email": "",
"name": "",
"recipientId": "2",
"routingOrder": "2",
"tabs": {
"signHereTabs": [
{
"anchorIgnoreIfNotPresent": "false",
"anchorString": "Signature_anchor_1",
"anchorUnits": "pixels",
"anchorYOffset": "0",
"name": "Please sign here",
"recipientId": "1"
}
]
}
}
]
},
"workflow": {
"workflowSteps": [
{
"action": "pause_before",
"itemId": "2",
"triggerOnItem": "routing_order"
}
]
},
"emailSubject": "DocuSign API - Signature Request on Document Call",
"documents": [
{
"documentId": "1",
"name": "{{fileName}}",
"documentBase64": "{{fileBase64}}"
}
],
"status": "sent"
}
After the name/email is added by the agent, the process is paused and I set the clientUserId for the signer, I verified that it is added by calling the get recipients info API. After I resume the process, an email is sent by DocuSign to the signer and I cannot get the embedded signing URL for that signer. I can see the clientUserId is removed for that signer by calling the get recipients info API again.
My question is:
when using agents/intermediaries in DocuSign, is it possible that we can obtain the embedded signing URL for the assigned signer whose email is updated/added by agents/intermediaries?
when using agents/intermediaries in DocuSign, is it possible that we can turn off that email from DocuSign to the signer, whose email is updated/added by agents/intermediaries?
when using agents/intermediaries in DocuSign, is it possible that we can obtain the embedded signing URL for the assigned signer whose email is updated/added by agents/intermediaries?
Yes, but you'll first need to assign a clientUserId to the recipient.
And since the recipient has already been sent an email invite to the signing ceremony, adding a clientUserId attribute is problematic since doing so will invalidate the email invite.
when using agents/intermediaries in DocuSign, is it possible that we can turn off that email from DocuSign to the signer, whose email is updated/added by agents/intermediaries?
To do this, you need to stop the workflow as I described in the other answer.
Much better would be to expand your API application so that it is used to change the name/email of the signer. That way your application can also set the clientUserId at the same time and the signer won't receive any email.
Basically, embedded signing is only intended to work if the envelope is created/edited via an API program. Your goal of using an API program and using the regular DocuSign Web App (which focuses on email delivery, not embedded signing) is mixing apples and oranges. It is possible but problematic.
You can potentially use the new Advanced Recipient Routing (ARR) feature to pause the envelope, obtain the information about the next recipient (via GET call to listRecipients) and then modify it to add the clientUserId. I have not tried this, but in theory that should work.
ARR is now available in demo/developer accounts for all new accounts created.
https://developers.docusign.com/docs/esign-rest-api/how-to/pause-workflow has information about how to create the envelope such that it pauses after a specific routing number.
https://developers.docusign.com/docs/esign-rest-api/how-to/unpause-workflow shows how to resume the envelope once you made your change.
The other thing you may need to do is add a webhook call for when the status of the intermediary was updated so you know when to update the next recipient (but before you can do that you would have to obtain the information about the new recipient).

Is it possible to use a returnUrl when sending a sign request in Docusign

I am wondering whether it is possible to use a returnUrl which the user is redirected to after signing the document, but using the path where you email the sign request out to the recipients.
The embedded flow does not work for us, unless I am missing something, because the 5 minute timeout does not work.
I would like to email the sign requests out to the recipients and then after they complete their signing redirect them to a custom "thank you" page.
The issue is that you can have one sign immediately, but the other recipients take days, and by the time they get to the request it is timed out. I have also tried to recreate the RecipientViewRequest, but the new URL simply shows me the document to sign without the option to sign it, even though the watermark says "In Progress".
I am using the C# SDK, and any help would be appreciated.
For sending emails to embedded recipients, specify clientUserId and embeddedRecipientStartURL when creating the Recipient.
embeddedRecipientStartURL : This is a sender provided valid URL string for redirecting an embedded recipient. When using this option, the embedded recipient still receives an email from DocuSign, just as a remote recipient would, but when the document link in the email is clicked the recipient is redirected, through DocuSign, to this URL to complete their actions. When routing to the URL, it is up to the sender’s system (the server responding to the URL) to then request a recipient token to launch a signing session.
Here is a sample createEnvelope request
{
"emailSubject": "Please sign the agreement",
"status": "sent",
"recipients": {
"signers": [
{
"email": "janedoe#acme.com",
"name": "jane doe",
"recipientId": 1,
"clientUserId":"1234",
"embeddedRecipientStartURL":"<Add Url to your App here>",
"tabs": {"signHereTabs": [{ "documentId": "1", "pageNumber": "1", "xPosition": "80", "yPosition": "80"}]}
}
]
},
"documents": [{ "documentId": "1", "name": "Contract", "fileExtension": "txt", "documentBase64": "RG9jIFRXTyBUV08gVFdP" }]
}
When the recipient clicks the link in their email, he is redirected to the url that you specify in embeddedRecipientStartURL. After your app authenticates and identifies the recipient, You will then have to request a recipient token using the CreateRecipientView api and specify the url for the custom thank you page in the returnUrl parameter. Make sure you include https://
{
"email": "janedoe#acme.com",
"userName": "jane doe",
"recipientId": 1,
"clientUserId":"1234",
"returnUrl":"https://www.google.com", //Include your custom thank you page here
"AuthenticationMethod" :"email"
}
Also see this answer

Send envelope to another recipient

I am trying to send a DocuSign envelope, that has already been sent to a customer (not signed yet), to another or a new customer. This is slightly different from resending the contract, but the same envelope is being resent to a new contact.
Is this possible? I have tried all sorts of things, like change the recipient details to new contact, add new sender to the existing recipient details.
The document is sent to the original sender fine, but to the new sender, the tab information is missing and the sign here tab is not there.
Replacing the original recipient :
The original recipient can be replaced with a new recipient using the UpdateEnvelopeRecipients api.
The original recipient will no longer have access to the envelope.
PUT /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients
{
"signers": [
{
"recipientId": 1,
"email": "newsigner#acme.com",
"name": "New Signer",
}
]
}
Adding a new recipient: To add a new recipient in addition to the existing recipients, use the CreateEnvelopeRecipients api.
POST /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients
{
"signers": [
{
"recipientId": 2,
"email": "newsigner#acme.com",
"name": "New Signer"
}
]
}
To Add tabs to the new recipient, use the CreateEnvelopeRecipientTabs api. Make sure you specify the recipientId correctly in the Url.
POST /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs
{
"signHereTabs": [
{
"documentId": "1",
"pageNumber": "1",
"xPosition": "120",
"yPosition": "120",
}
]
}

Filtering Envelopes based on a type

I have a situation where I want to be able to differentiate between envelopes based on a 'type'. For example, I'll have quotes and invoices, both of these can be sent to the same person so I'd like to know if there's a way of checking some sort of field that could differentiate the two. Currently I'm rather crudely post processing the API results and checking for 'quote' in the document type and I'd like a rather more reliable solution
thanks,
Oliver
You can use Envelope Custom Fields aka Document labels to specify additional metadata for an envelope.
Envelope Custom fields aka Document labels can be used in the envelopes for your account to record information about the envelope, help search for envelopes and track information. The envelope custom fields are not seen by the envelope recipients.
The DocuSign Web sending tool refers to the Envelope Custom fields as Document Labels. You can configure Document Labels as an Administrator on the Account. See instructions here
Once the Document labels are configured at the account level, you can provide label values for each envelope you send through the web sending tool. See instructions here
The other option is to specify Envelope Custom fields using the API. Here is a sample createEnvelope api request that specifies custom Fields associated with the envelope
{
"emailSubject": "Envelope with custom fields",
"status": "sent",
"customFields": {
"listCustomFields": [
{
"listItems": [
"sample string 1"
],
"name": "myListField",
"required": "true",
"show": "true",
"value": "MyListValue"
}
],
"textCustomFields": [
{
"name": "MyOwnTextField",
"required": "true",
"show": "true",
"value": "MyValue"
}
]
},
"recipients": {
"signers": [
{
"recipientId": 1,
"email": "kaysmith#acme.com",
"name": "kay smith",
"routingOrder": "1"
}
]
},
"documents": [
{
"documentId": "1",
"name": "Agreement",
"fileExtension": "txt",
"documentBase64": "RG9jIFRXTyBUV08gVFdP"
}
]
}
More good news: the DocuSign Sending web tool automatically enables the sender, from the web tool, to set the Envelope Custom Fields.
So if you are sending envelopes programmatically or your users are sending them, it is easy to set custom field values.

Resources