Resend DocuSign Emails - docusignapi

Is there an API endpoint which allows me to retrigger emails to recipients? Sometimes users may not get or lose the DocuSign emails which contain their signing link. I'd like to be able to send those emails again on demand.

You can use the "modify recipient(s)" request to trigger a re-send of the email notification to specific recipient(s).
PUT /accounts/{accountId}/envelopes/{envelopeId}/recipients?resend_envelope=true
Be sure to include the querystring parameter/value resend_envelope=true in the URL (as shown above).
For example, if a GET Recipients response shows that an Envelope contains the following recipients:
{
"signers": [
{
"name": "Jane Doe",
"email": "janesemail#outlook.com",
"recipientId": "3",
"recipientIdGuid": "13e30b8d-3dd6-48e8-ad12-15237611a463",
"requireIdLookup": "false",
"userId": "2c9e06eb-f2c5-4bef-957a-5a3dbd6edd25",
"routingOrder": "1",
"status": "sent"
},
{
"name": "John Doe",
"email": "johnsemail#outlook.com",
"recipientId": "1",
"recipientIdGuid": "c2273f0f-1430-484a-886c-45ce2fb5e8a8",
"requireIdLookup": "false",
"userId": "03c8a856-c0ae-41bf-943d-ac6e92db66a8",
"routingOrder": "1",
"note": "",
"roleName": "Signer1",
"status": "sent",
"templateLocked": "false",
"templateRequired": "false"
}
],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [],
"certifiedDeliveries": [],
"inPersonSigners": [],
"recipientCount": "2",
"currentRoutingOrder": "1"
}
Then, I could trigger a re-send of the Signing Invitation Email to the incomplete recipient ("Jane Doe") by using the following request:
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"
}
]
}
Notice that I'm sending the same (original) values for name and email -- so it's not going to actually modify the recipient -- it'll just re-send the email to Jane, since I included ?resend_envelope=true in the URL.
API Documentation
If you want to re-send the email notification to all pending recipients (i.e., anyone who's next in the routing order and hasn't yet completed the envelope), you can do so with the following request:
PUT https://demo.docusign.net/restapi/v2/accounts/<accountID>/envelopes/<envelopeID>?resend_envelope=true
{}

You can use docusign's latest API using nuget package manager "DocuSign.eSign.Api".
I did it using C#:
//Very first prepare Recepients:
Recipients recpnts = new Recipients
{
//CurrentRoutingOrder = "1", // Optional.
Signers = new List<Signer>()
{
new Signer
{
RecipientId = "1",
RoleName = "Prospect",
Email = "ert#gmail.com",
Name = "Shyam",
},
}
};
// Call Envelopes API class which has UpdateRecepient Method
EnvelopesApi epi = new EnvelopesApi();
var envelopeId ="62501f05-4669-4452-ba14-c837a7696e04";
var accountId = GetAccountId();
// The following Line is responsible for Resend Envelopes.
RecipientsUpdateSummary recSummary = epi.UpdateRecipients(accountId, envelopeId , recpnts);
// Get Status or Error Details.
var summary = recSummary.RecipientUpdateResults.ToList();
var errors = summary.Select(rs => rs.ErrorDetails).ToList();
// Method to get your Docusign Account Details and Authorize it.
private static string GetAccountId()
{
string username = "Account Email Address";
string password = "Account Password;
string integratorKey = "Your Account Integrator Key";
// your account Integrator Key (found on Preferences -> API page)
ApiClient apiClient = new ApiClient("https://demo.docusign.net/restapi");
Configuration.Default.ApiClient = apiClient;
// configure 'X-DocuSign-Authentication' header
string authHeader = "{\"Username\":\"" + username + "\", \"Password\":\"" + password + "\", \"IntegratorKey\":\"" + integratorKey + "\"}";
Configuration.Default.AddDefaultHeader("X-DocuSign-Authentication", authHeader);
// we will retrieve this from the login API call
string accountId = null;
/////////////////////////////////////////////////////////////////
// STEP 1: LOGIN API
/////////////////////////////////////////////////////////////////
// login call is available in the authentication api
AuthenticationApi authApi = new AuthenticationApi();
LoginInformation loginInfo = authApi.Login();
accountId = loginInfo.LoginAccounts[0].AccountId;
return accountId;
}

I'm not sure if a separate api call exists just to resend the envelope (notification), however you might be able to get away with it by using the Modify or Correct and Resend Recipient Info api call.
That call is normally used to correct information about your recipients- for instance, if you created an envelope with an incorrect email address or perhaps have the wrong name for someone you could use this call to modify the email address and resend the envelope. And when you make the call there is an optional query parameter called
?resend_envelope={true or false}
Try making this call but instead of altering any recipient information, simple append the URL parameter and that might resend the envelope.
Documentation

I know this is extremely old but I wanted to post how I did it using the latest SDK (DocuSign.eSign.dll 5.12.0).
var account = ...;
var accessToken = ...;
var apiClient = new ApiClient($"{account.BasePath}/restapi");
apiClient.Configuration.DefaultHeader.Add("Authorization", $"Bearer {accessToken}");
var envelopesApi = new EnvelopesApi(apiClient);
var envelope = new Envelope
{
EnvelopeId = envelopeId
};
await envelopesApi.UpdateAsync(account.Id, envelopeId, envelope, new EnvelopesApi.UpdateOptions { resendEnvelope = "true" });

Here it is for SOAP without changing the recipients info:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.docusign.net/API/3.0">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>[integratorKey]UserName</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ns:CorrectAndResendEnvelope>
<ns:Correction>
<ns:EnvelopeID>1234</ns:EnvelopeID>
<ns:RecipientCorrections>
<ns:RecipientCorrection>
<ns:PreviousUserName>userName</ns:PreviousUserName>
<ns:PreviousEmail>user#email.com</ns:PreviousEmail>
<ns:PreviousRoutingOrder>1</ns:PreviousRoutingOrder>
<ns:Resend>true</ns:Resend>
</ns:RecipientCorrection>
</ns:RecipientCorrections>
</ns:Correction>
</ns:CorrectAndResendEnvelope>
</soapenv:Body>
</soapenv:Envelope>

To replicate the behavior of the "Resend" button in the UI
pick the next person in the order, and send them an email of what to do
you can use API Explorer to just filling out the account ID, envelope ID, and Oauth Token, then setting resend-envelope to true
Like this curl:
curl --request PUT \
--url 'https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes/{envelopeId}?resend_envelope=true' \
--header 'accept: application/json' \
--header 'accept-encoding: gzip,deflate,sdch' \
--header 'accept-language: en-US,en;q=0.8,fa;q=0.6,sv;q=0.4' \
--header 'authorization: {bearerToken}' \
--header 'cache-control: no-cache' \
--header 'content-type: application/json' \
--data '{}'
note: this in the body is required, or it will 400 you
{}

These days, if you're having problems with signers not noticing the DocuSign signing request email in their overloaded in-boxes, I recommend send the message via email + SMS.
Here's a live API Request Builder example that sends via email and SMS.
You can also send SMS only if you wish. Live example

Related

DocuSign: how to attach custom properties to an envelope

Hello we are looking to attach an application number to Docusign request (an envelope) with the API.
How can we attach custom properties to an envelope, to pass some reference to a particular transaction, so it is part of the payload sent back in the webhook when signing is complete?.
What we have tried is below:
let recipients = docusign.Recipients.constructFromObject({
signers: [signer1],
carbonCopies: [cc1],
applicationNo: app.id,
})
env.recipients = recipients
env.applicationNo = "someApplicationNumber"
env.status = args.status
From your code example, it looks like you want to attach metadata at the envelope (transaction) level. To do that, use EnvelopeCustomFields
You can create use either strings or enumerated string values.
You can include them in the envelope definition. See here or you can use separate API calls for them
You can have them included in the certificate of completion document if you want.
Example using the Node.js SDK for an EnvelopeCustomField named applicationNo:
let textCustomField1 = docusign.TextCustomField.constructFromObject({
name: "applicationNo",
show: "true", // show the field in the certificate of completion
value: "12345"
});
let textCustomFields1 = [textCustomField1];
let customFields1 = docusign.CustomFields.constructFromObject({
textCustomFields: textCustomFields1
});
...
let envelopeDefinition = docusign.EnvelopeDefinition.constructFromObject({
customFields: customFields1,
documents: documents1,
emailSubject: "Please sign the attached document",
recipients: recipients1,
status: "sent"
});
Same example in JSON:
"envelopeDefinition": {
"emailSubject": "Please sign the attached document",
"status": "sent",
"customFields": {
"textCustomFields": [
{
"name": "applicationNo",
"show": "true",
"value": "12345"
}
]
},
"documents": ....
The certificate of completion.
Notice the applicationNo data

DocuSign Resend Envelope to User with Subject correction

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

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

Envelope went out, but according to Docusign it says "Waiting for Others"

I ran a quick test with the RestAPI, using TemplateRoles instead of signers. Here is the code, pretty short:
EnvelopesApi api = new EnvelopesApi();
EnvelopeDefinition ed = new EnvelopeDefinition();
ed.EmailSubject = "here is the subject for this email";
ed.TemplateRoles = new List<TemplateRole>();
TemplateRole tr1 = new TemplateRole();
tr1.Name = "Kathy xxx";
tr1.Email = "kathyxxx#gmail.com";
tr1.RoutingOrder = "1";
tr1.RoleName = "Customer_SellerName";
tr1.ClientUserId = "1";
ed.TemplateRoles.Add(tr1);
ed.TemplateId = "3041bf29-a7a8-4903-89b1-577dec8fd591";
ed.Status = "sent";
EnvelopeSummary es = api.CreateEnvelope(AccountId, ed);
Here is the envelope definition and summary:
envelope definition
{
"templateId": "3041bf29-a7a8-4903-89b1-577dec8fd591",
"templateRoles": [
{
"email": "kathyxxx#gmail.com",
"roleName": "Customer_SellerName",
"name": "Kathy xxx",
"clientUserId": "1",
"routingOrder": "1"
}
],
"status": "sent",
"emailSubject": "here is the subject for this email"
}
{
"envelopeId": "7676b171-ccb7-4b40-821b-e1973ec99dfd",
"uri": "/envelopes/7676b171-ccb7-4b40-821b-e1973ec99dfd",
"statusDateTime": "2017-05-03T18:43:36.6770000Z",
"status": "sent"
}
There is only one person getting the envelope, why does it say it is waiting for others?
If an envelope has at least one recipient who has yet to complete their action then it will show up under Waiting For Others in the Sender View.
From Documentation
Waiting for Others. The document has at least one recipient who has yet to complete their action. The recipient status in the Document details shows whether the outstanding recipients need to sign (Needs to Sign) or view (Needs to View) your document.
I got it to work, but not sure why this worked. I commented out the ClientUserId and the envelope went out fine. Now I need to see what this ClientUserId property really does.

Docusign API Invalid email address error with signature from document request with inPersonSigner recipient type

I'm currently testing an API call that will ultimately allow for an agent to provide signature and another party to sign in person. In sending the call via API Explorer I continue to receive the following response:
{
"errorCode": "INVALID_EMAIL_ADDRESS_FOR_RECIPIENT",
"message": "The email address for one of the recipients is not valid."
}
I've read in the REST API guide that this needs to be enabled for my account; it may be that my demo dev account does not have this enabled. I just need to verify whether or not that I'm not omitting any essential parameters in this call. I've tried passing in my email (as the account holder) and still receive this error. Here is my request body JSON:
{
"emailBlurb": "test",
"emailSubject": "test",
"documents": [
{
"name": "ChiropractorPlusApplication.pdf",
"documentId": "1"
}
],
"recipients": {
"inPersonSigners": [
{
"hostName": "Joe Host",
"recipientId": "1",
"name": "Name",
"email": "host#gmail.com",
"signerName": "Insured"
}
]
},
"status": "sent"
}
Thanks!
I believe you have found a bug with the REST API Explorer in that it's missing at least one field for In Person Signers. If you look at the REST API documentation you'll see that there's one more required parameter for In Person Signers, which is the hostEmail
Try adding to your JSON
"hostEmail" : "host's email address",
And I have a feeling that will do the trick. See page 275 of REST API v2 PDF for info on In Person Signers recipient type. It first shows a sample request with all the options then below that it lists the required fields for this recipient type:
http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf

Resources