Docusignapi 使用Rest api更正Docusign中信封的收件人
我正在更改一个特定信封的签名人,方法是使用下面的代码更新收件人的签名,该代码工作正常Docusignapi 使用Rest api更正Docusign中信封的收件人,docusignapi,Docusignapi,我正在更改一个特定信封的签名人,方法是使用下面的代码更新收件人的签名,该代码工作正常 EnvelopesApi envelopeApi = new EnvelopesApi(); var options = new EnvelopesApi.UpdateRecipientsOptions() {
EnvelopesApi envelopeApi = new EnvelopesApi();
var options = new EnvelopesApi.UpdateRecipientsOptions()
{
resendEnvelope = "true",
//offlineSigning="true"
};
Signer signerobj = new Signer
{
Email = handoverOwnerEmail,
Name = handoverOwnerName,
RecipientId = "1",
RoutingOrder = "1",
};
CarbonCopy carbonCopyobj = new CarbonCopy
{
RecipientId = removesigner.recipientId,
Name = removesigner.name,
Email = removesigner.email,
};
Recipients objrecipients = new Recipients
{
Signers = new List<Signer>() { signerobj },
CarbonCopies = new List<CarbonCopy> { carbonCopyobj }
};
RecipientsUpdateSummary result1 = envelopeApi.UpdateRecipients(accoutnId, folderitem.envelopeId, objrecipients, options);
EnvelopesApi-envelopeApi=new-EnvelopesApi();
var options=new EnvelopesApi.UpdateRecipientsOptions()
{
resendedevelope=“true”,
//offlineSigning=“true”
};
签名者signerobj=新签名者
{
电子邮件=移交所有者电子邮件,
名称=切换所有者名称,
RecipientId=“1”,
RoutingOrder=“1”,
};
CarbonCopy CarbonCopy obj=新的复写
{
RecipientId=removesigner.RecipientId,
Name=removesigner.Name,
Email=removesigner.Email,
};
Recipients objrecipients=新收件人
{
Signers=new List(){signerobj},
CarbonCopies=新列表{carbonCopyobj}
};
RecipientsUpdateSummary result1=EnveloperAPI.UpdateRecipients(AccountId、folderitem.envelopeId、objrecipients、options);
上述代码对有效电子邮件或错误电子邮件返回相同的状态。如果我提供的电子邮件无效,则已发送邮件中的信封状态将变为失败,如下图所示。
如果我们登录到Docusign,我们可以选择更正收件人的详细信息
是否可以使用RESTAPI获取失败状态信封并更新收件人电子邮件
我认为我们可以获得失败信封,并使用有效的收件人电子邮件更新收件人的电子邮件如果收件人的电子邮件地址导致自动回复电子邮件,Connect可以向您发送webhook通知。我认为这是导致
失败
通知的错误
我怀疑一个坏的电子邮件地址是否会立即导致失败
状态。相反,DocuSign尝试发送到提供的电子邮件地址,如果发送失败并返回到DocuSign的电子邮件错误,则您将看到失败状态
您还可以使用或查看错误
更新:检查收件人
状态,查看是否有任何收件人具有自动回复
状态
由于电子邮件地址错误是异步检测的,因此连接(或特定信封的eventNotification)是最佳方式。否则,您需要轮询状态更改。如果收件人的电子邮件地址导致出现自动回复的
电子邮件,Connect可以向您发送webhook通知。我认为这是导致失败
通知的错误
我怀疑一个坏的电子邮件地址是否会立即导致失败
状态。相反,DocuSign尝试发送到提供的电子邮件地址,如果发送失败并返回到DocuSign的电子邮件错误,则您将看到失败状态
您还可以使用或查看错误
更新:检查收件人
状态,查看是否有任何收件人具有自动回复
状态
由于电子邮件地址错误是异步检测的,因此连接(或特定信封的eventNotification)是最佳方式。否则,您将需要轮询状态更改。我们有一个自动作业,用于检查被退回的电子邮件。以下是使用XML的代码:
strURL = DocuSign_Get_AcctInfo
If strURL = "" Then
GoTo Exit_StdExit
End If
strURLGetSent = strURL & "/envelopes?from_date=" & strFromDate & "&status=sent"
Set XDoc = CreateObject("MSXML2.DOMDocument.6.0")
XDoc.SetProperty "SelectionLanguage", "XPath"
XDoc.SetProperty "SelectionNamespaces", "xmlns:r='http://www.docusign.com/restapi' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'"
XDoc.async = False
XDoc.validateOnParse = True
With DocEnv
.Open "GET", strURLGetSent, False
.setRequestHeader "Content-Type", "application/xml"
.setRequestHeader "Accept", "application/xml"
.setRequestHeader "X-DocuSign-Authentication", "<DocuSignCredentials><Username>" + strUsrNm + "</Username><Password>" + strPssWrd + "</Password><IntegratorKey>" + strKey + "</IntegratorKey></DocuSignCredentials>"
.Send
XDoc.LoadXML (PrettyPrintXml(.responseText))
End With
' XDoc.Save ("U:\data\DocuSign\notsigned.xml")
If XDoc.parseError <> 0 Then
MsgBox "Invalid XML!" & vbCrLf & vbCrLf & XDoc.parseError.reason
GoTo Exit_StdExit
End If
lngRcrdCnt = XDoc.SelectSingleNode("//r:resultSetSize").Text
If lngRcrdCnt = 0 Then
Email_Bounced = True 'query worked but returned no records
GoTo Exit_StdExit
End If
ReDim AcctID(lngRcrdCnt - 1)
lngIdx = 0
'loop through the collection of nodes to capture the envelopeID
Set XNodes = XDoc.SelectNodes("//r:*")
For Each XNode In XNodes
If XNode.nodeName = "envelopeID" Then
AcctID(lngIdx) = XNode.Text
lngIdx = lngIdx + 1
End If
Next XNode
For lngIdx = 0 To lngRcrdCnt - 1
strURLGetBounce = strURL & "/envelopes/" & AcctID(lngIdx) & "/recipients"
Set responseDoc = CreateObject("MSXML2.DOMDocument.6.0")
responseDoc.SetProperty "SelectionLanguage", "XPath"
responseDoc.SetProperty "SelectionNamespaces", "xmlns:r='http://www.docusign.com/restapi' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'"
responseDoc.async = False
responseDoc.validateOnParse = True
With DocRecip
.Open "GET", strURLGetBounce, False
.setRequestHeader "Content-Type", "application/xml"
.setRequestHeader "Accept", "application/xml"
.setRequestHeader "X-DocuSign-Authentication", "<DocuSignCredentials><Username>" + strUsrNm + "</Username><Password>" + strPssWrd + "</Password><IntegratorKey>" + strKey + "</IntegratorKey></DocuSignCredentials>"
.Send
responseDoc.LoadXML (PrettyPrintXml(.responseText))
End With
Set XNodes = responseDoc.SelectNodes("//r:errorCode")
For Each XNode In XNodes
MsgBox "The following error has occurred: " & XNode.Text & vbCrLf & vbCrLf & "See file U:\data\DocuSign_PutResponseError.xml" & " for more info"
GoTo Exit_StdExit
Next XNode
If responseDoc.SelectSingleNode("//r:status").Text = "autoresponded" Then
'this call sets the values for lngPrsnID, lngFctyApptAID
Call DocuSign_Get_CustomFlds(strURL & "/envelopes/" & AcctID(lngIdx) & "/custom_Fields", lngPrsnID, lngFctyApptAID)
strEmail = responseDoc.SelectSingleNode("//r:email").Text
modConnection.OpenADODBConnection.Execute ("insert into _FctyLtrsEmlBounce(lngPrsnID, lngFctyApptAID, strEmlDocuSign) values(" & lngPrsnID & ", " & lngFctyApptAID & ", '" & strEmail & "')")
End If
Next lngIdx
''''
strURL=DocuSign\u Get\u AcctInfo
如果strURL=”“,则
转到出口
如果结束
strURLGetSent=strURL&“/envelopes?from_date=“&strFromDate&”&status=sent”
设置XDoc=CreateObject(“MSXML2.DOMDocument.6.0”)
XDoc.SetProperty“SelectionLanguage”、“XPath”
XDoc.SetProperty“SelectionNamespaces”,“xmlns:r=”http://www.docusign.com/restapi”“我http://www.w3.org/2001/XMLSchema-instance'"
XDoc.async=False
XDoc.validateOnParse=True
与DocEnv
.打开“获取”,strURLGetSent,False
.setRequestHeader“内容类型”、“应用程序/xml”
.setRequestHeader“接受”、“应用程序/xml”
.setRequestHeader“X-DocuSign-Authentication”,“”+strUsrNm+“”+strpswrd+“”+strKey+“”
.发送
XDoc.LoadXML(PrettyPrintXml(.responseText))
以
'XDoc.Save(“U:\data\DocuSign\notsigned.xml”)
如果XDoc.parseError为0,则
MsgBox“无效XML!”&vbCrLf&vbCrLf&XDoc.parseError.reason
转到出口
如果结束
lngRcrdCnt=XDoc.SelectSingleNode(“//r:resultSetSize”).Text
如果lngRcrdCnt=0,则
Email_bounched=True“查询已运行,但未返回任何记录
转到出口
如果结束
雷迪姆账户(lngRcrdCnt-1)
LNGIX=0
'循环遍历节点集合以捕获信封ID
设置XNodes=XDoc.SelectNodes(//r:*)
对于XNodes中的每个XNode
如果XNode.nodeName=“信封ID”,则
AcctID(lngIdx)=XNode.Text
lngIdx=lngIdx+1
如果结束
下一个XNode
对于LNGIX=0到lngRcrdCnt-1
strURLGetBounce=strURL&“/envelopes/”&AcctID(lngIdx)&“/recipients”
Set responseDoc=CreateObject(“MSXML2.DOMDocument.6.0”)
responseDoc.SetProperty“SelectionLanguage”、“XPath”
responseDoc.SetProperty“SelectionNamespaces”,“xmlns:r=”http://www.docusign.com/restapi”“我http://www.w3.org/2001/XMLSchema-instance'"
responseDoc.async=False
responseDoc.validateOnParse=True
与DocRecip
.打开“获取”,strURLGetBounce,False
塞特先生