是否有 API 端点允许我重新向收件人发送电子邮件?有时,用户可能无法收到或丢失包含签名链接的 DocuSign 电子邮件。我希望能够根据需要再次发送这些电子邮件。
您可以使用“修改收件人”请求来触发向特定收件人重新发送电子邮件通知。
PUT /accounts/{accountId}/envelopes/{envelopeId}/recipients?resend_envelope=true
请务必在 URL 中包含查询字符串参数/值 resend_envelope=true(如上所示)。
例如,如果 GET Recipients 响应显示信封包含以下收件人:
{
"signers": [
{
"name": "Jane Doe",
"email": "[email protected]",
"recipientId": "3",
"recipientIdGuid": "13e30b8d-3dd6-48e8-ad12-15237611a463",
"requireIdLookup": "false",
"userId": "2c9e06eb-f2c5-4bef-957a-5a3dbd6edd25",
"routingOrder": "1",
"status": "sent"
},
{
"name": "John Doe",
"email": "[email protected]",
"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"
}
然后,我可以使用以下请求触发将签名邀请电子邮件重新发送给不完整的收件人(“Jane Doe”):
PUT https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{envelopeId}}/recipients?resend_envelope=true
{
"signers": [
{
"recipientId": "3",
"name": "Jane Doe",
"email": "[email protected]"
}
]
}
请注意,我为 name 和 email 发送相同的(原始)值 - 因此它不会实际修改收件人 - 它只会将电子邮件重新发送给 Jane,因为我包含了 URL 中的 ?resend_envelope=true。
如果您想将电子邮件通知重新发送给所有待处理的收件人(即路由顺序中的下一个且尚未完成信封的任何人),您可以通过以下请求来执行此操作:
PUT https://demo.docusign.net/restapi/v2/accounts/<accountID>/envelopes/<envelopeID>?resend_envelope=true
{}
您可以使用 nuget 包管理器“DocuSign.eSign.Api”来使用 docusign 的最新 API。
我使用 C# 完成的:
//首先准备接收者:
Recipients recpnts = new Recipients
{
//CurrentRoutingOrder = "1", // Optional.
Signers = new List<Signer>()
{
new Signer
{
RecipientId = "1",
RoleName = "Prospect",
Email = "[email protected]",
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;
}
我知道这已经非常旧了,但我想发布我是如何使用最新的 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" });
我不确定是否存在单独的 api 调用只是为了重新发送信封(通知),但是您可以通过使用 修改或更正并重新发送收件人信息 api 调用来摆脱它。
该调用通常用于更正有关收件人的信息 - 例如,如果您创建了一个包含错误电子邮件地址的信封,或者可能有错误的某人姓名,您可以使用此调用来修改电子邮件地址并重新发送信封。 当您拨打电话时,有一个可选的查询参数,称为
?resend_envelope={true or false}
尝试拨打此电话,但不要更改任何收件人信息,只需附加 URL 参数,这可能会重新发送信封。
这是 SOAP,无需更改收件人信息:
<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>[email protected]</ns:PreviousEmail>
<ns:PreviousRoutingOrder>1</ns:PreviousRoutingOrder>
<ns:Resend>true</ns:Resend>
</ns:RecipientCorrection>
</ns:RecipientCorrections>
</ns:Correction>
</ns:CorrectAndResendEnvelope>
</soapenv:Body>
</soapenv:Envelope>
复制 UI 中“重新发送”按钮的行为
选择订单中的下一个人,并向他们发送一封电子邮件,告知要做什么
您可以使用 API Explorer 填写帐户 ID、信封 ID 和 Oauth Token,然后将 resend-envelope 设置为 true
就像这个卷发:
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 '{}'
注意:正文中的这个是必需的,否则会400你
{}
如今,如果您遇到签名者没有注意到超载收件箱中的 DocuSign 签名请求电子邮件的问题,我建议通过电子邮件 + 短信发送消息。
这是通过电子邮件和短信发送的实时 API 请求生成器示例。
您也可以仅根据需要发送短信。 实例
我花了一些时间使用 Node.js SDK 来解决这个问题。 jtrose22 的回答确实对我有帮助,所以我想我也会为 Node.js 解决方案做出贡献:
await envelopeApi.update(
organizationAccountId,
envelopeId,
{
resendEnvelope: 'true',
},
);
您可以在 Node.js SDK 中找到它: https://docusign.github.io/docusign-esign-node-client/module-api_EnvelopesApi.html#update
在“参数”表中,它是
optsOrCallback
参数的属性。