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",
}
]
}
Related
I'm trying to make it so that specific signers to a document can be sent an envelope via SMS instead of email. I am using server templates to create the envelopes, but the examples don't seem to agree on whether to use a TemplateRole or use a Signer to create the envelope. So far I've been using TemplateRole, but it does not seem like there is a delivery method option (for only SMS).
In looking for answers I found a small reference to a bug "TT-3902" that was referenced two years ago and also on a post to the Java SDK, but at the same time another post from a year ago says it is possible - but the link to the API Explorer shows only using a Signer object, not a TemplateRole object...
Questions: Can I use the TemplateRole this way but haven't found the right example? Is there a workaround? Has bug TT-3902 been fixed? Do I need to recode my entire Envelope creation process to be different just to use the Signer objects instead?
Current Code (using Python SDK):
signer = TemplateRole(
role_name=signer_provided["role_name"],
name=signer_provided["name"],
email=signer_provided["email"],
tabs=tabs,
)
What I want to program for SMS delivery:
phone_number = RecipientPhoneNumber(country_code="1", number=signer_provided["phone_number"])
signer = TemplateRole(
delivery_method="SMS",
role_name=signer_provided["role_name"],
name=signer_provided["name"],
phone_number=phone_number,
tabs=tabs,
)
I also tried:
phone_number = RecipientPhoneNumber(country_code="1", number=signer_provided.get("phone_number"))
additional_notification = RecipientAdditionalNotification(secondary_delivery_method="SMS", phone_number=phone_number)
signer = TemplateRole(
additional_notification=additional_notification,
role_name=signer_provided["role_name"],
name=signer_provided["name"],
email=signer_provided["email"],
tabs=tabs,
)
But this only sent an email (using my developer account) and not an SMS at all. I would like it to only send via SMS in this case.
You will need to use Composite Templates for this to work
Here is what the JSON looks like:
{
"envelopeDefinition": {
"status": "sent",
"compositeTemplates": [
{
"compositeTemplateId": "1",
"serverTemplates": [
{
"sequence": "1",
"templateId": "1b66677c-xxxx-xxxx-xxxx-655a7c3890d9"
}
],
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"name": "Signer Name",
"roleName": "signer",
"deliveryMethod": "SMS",
"recipientId": "1",
"phoneNumber": {
"countryCode": "",
"number": ""
},
"tabs": {
"textTabs": [
{
"tabLabel": "signer_title",
"value": "Manager"
}
]
}
}
]
}
}
]
}
]
},
"envelopesCreateQP": {}
}
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).
I made custom reminders for my integration that resends the envelope to user. This is work for me:
PUT https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{envelopeId}}/recipients?resend_envelope=true
{
"signers": [
{
"recipientId": "3",
"name": "Jane Doe",
"email": "janesemail#outlook.com"
}
]
}
But I want to send different subject to include "Reminder:"+old subject, how can I modify the emailSubject for specific recipient (which I'm passing to Body), I tried:
{
"signers": [
{
"recipientId": "1",
"name": "Igor",
"email": "mail#example.com",
"emailNotification":
{
"emailSubject": "ReMiNdEr"
}
}
]
}
But this did not work. Any suggestions?
You will need to do a POST to the recipients endpoint to update the recipientEmailNotification for the specific recipient with the emailSubject and emailBody you wish.
See reference information
See blog post with code examples in six languages (using the various DocuSign SDKs)
So, to resend for recipient envelope with new Subject I need first to determine this property in my POST request, and then I can use PUT with following to update subject, body. If I will not determine this in my 1st POST request, this PUT will not work!
"emailNotification": {
"emailBody": "NEWSUBJ 44 5",
"emailSubject": "NEWNEWNEW 44 5"
},
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"
}
]
}
}
]
}
I can create an envelope with recipients with tabs. I can also create an envelope, add additional recipients, then add tabs to those recipients. This takes two requests, (1) add recipient, (2) add tab to recipient. I can't get Docusign to add a recipient and tabs dynamically in one call. I've started by trying to get it to work using the REST API Explorer:
PostEnvelopeRecipients
Which results in the following request:
{
"signers": [
{
"clientUserId": "1234",
"email": "testuser6#example.com",
"name": "tab testuser6",
"recipientId": "1234",
"tabs": {
"signHereTabs": [
{
"documentId": "1",
"pageNumber": "1",
"xPosition": "200",
"yPosition": "200"
}
]
}
}
]
}
This results in a recipient being added to the envelope properly, however it does not have any tabs. How can I add tabs when creating a recipient after the envelope is already created in one call?
It is not possible to add Tabs using the PostEnvelopeRecipients or PutEnvelopeRecipients api. After an envelope is created/sent, two separate calls are required to add recipients and tabs.