我收到" INVALID_EMAIL_ADDRESS_FOR_RECIPIENT"将以下XML提交到DocuSign API时出错。我尝试手动更改地址并为每个签名者使用不同的地址。当我可以向我直接尝试过电子邮件的任何地址发送电子邮件时,为什么请求会返回无效地址?
String [] emailaddr4 = new String {"cts@companyname.com", "me@companyname.com", "next@companyname.com", "last@companyname.com"};
String xml = "<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
"<accountId>" + accountId + "</accountId>" +
"<status>sent</status>" +
"<emailSubject>" + emailSubject + "</emailSubject>" +
"<emailBlurb>" + emailBlurb + "</emailBlurb>" +
"<templateId>81bcad0d-****-****-****-f281b24a4567</templateId>" +
"<templateRoles>" +
"<templateRole>" +
"<email>" + emailaddr4[0] + "</email>" +
"<userName>" + emailaddr4[0] + "</userName>" +
"<name>" + names[0] + "</name>" +
"<roleName>Student</roleName>" +
"<clientUserId>1</clientUserId>" +
"<tabs>" +
"<textTabs>" +
"<text>" +
"<tabLabel>sid</tabLabel>" +
"<value>" + student_id + "</value>" +
"</text>" +
"</textTabs>" +
"</tabs>" +
"</templateRole>" +
"<templateRole>" +
"<email>" + emailaddr4[1] + "</email>" +
"<name>" + names[1] + "</name>" +
"<roleName>Advisor</roleName>" + //must match role in envelope
"<userName>" + emailaddr4[1] + "</userName>" +
"<routingOrder>1</routingOrder>" +
"</templateRole>" +
"<templateRole>" +
"<email>" + emailaddr4[2] + "</email>" +
"<name>" + names[2] + "</name>" +
"<roleName>DeptHead</roleName>" +
"<userName>" + emailaddr4[2] + "</userName>" +
"<routingOrder>2</routingOrder>" +
"</templateRole>" +
"<templateRole>" +
"<email>" + emailaddr4[3] + "</email>" +
"<name>" + names[3] + "</name>" +
"<roleName>Dean</roleName>" +
"<userName>" + emailaddr4[3] + "</userName>" +
"<routingOrder>3</routingOrder>" +
"</templateRole>" +
"</templateRoles>" +
"</envelopeDefinition>";
以下是写入DataOutputSteam的实际XML
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<accountId>******</accountId>
<status>sent</status>
<emailSubject>This is a test.</emailSubject>
<emailBlurb>Java DS Test</emailBlurb>
<templateId>81bcad0d-****-****-****-f281b24a4567</templateId>
<templateRoles>
<templateRole>
<email>desk@test.edu</email>
<userName>desk@test.edu</userName>
<name>Tester</name>
<roleName>Student</roleName>
<clientUserId>1</clientUserId>
<tabs>
<textTabs>
<text>
<tabLabel>sid</tabLabel>
<value>6644</value>
</text>
</textTabs>
</tabs>
</templateRole>
<templateRole>
<email>desk@test.edu</email>
<name>Alan advisor</name>
<roleName>Advisor</roleName>
<userName>desk@test.edu</userName>
<routingOrder>1</routingOrder>
</templateRole>
<templateRole>
<email>desk@test.edu</email>
<name>CTS</name>
<roleName>DeptHead</roleName>
<userName>desk@mtech.edu</userName>
<routingOrder>2</routingOrder>
</templateRole>
<templateRole>
<email>desk@test.edu</email>
<name>Jennifer</name>
<roleName>Dean</roleName>
<userName>desk@test.edu</userName>
<routingOrder>3</routingOrder>
</templateRole>
</templateRoles>
</envelopeDefinition>
这是请求模板收件人时的响应。
<recipients xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<agents/>
<carbonCopies/>
<certifiedDeliveries/>
<editors/>
<inPersonSigners/>
<intermediaries/>
<recipientCount>4</recipientCount>
<signers>
<signer>
<recipientId>9d44f02b-****-****-****-db256768d013</recipientId>
<recipientIdGuid>9d44f02b-****-****-****-db256768d013</recipientIdGuid>
<requireIdLookup>false</requireIdLookup>
<roleName>Student</roleName>
<routingOrder>1</routingOrder>
<status>created</status>
<templateLocked>false</templateLocked>
<templateRequired>true</templateRequired>
<email/>
<name/>
<signInEachLocation>false</signInEachLocation>
</signer>
<signer>
<recipientId>3a1f0ff1-****-****-****-bbecca30dc1a</recipientId>
<recipientIdGuid>3a1f0ff1-****-****-****-bbecca30dc1a</recipientIdGuid>
<requireIdLookup>false</requireIdLookup><roleName>DeptHead</roleName>
<routingOrder>3</routingOrder>
<status>created</status>
<templateLocked>false</templateLocked>
<templateRequired>true</templateRequired>
<email/>
<name/>
<signInEachLocation>false</signInEachLocation>
</signer>
<signer>
<recipientId>2dd69109-****-****-****-4773cabe5632</recipientId>
<recipientIdGuid>2dd69109-****-****-****-4773cabe5632</recipientIdGuid>
<requireIdLookup>false</requireIdLookup>
<roleName>Advisor</roleName>
<routingOrder>2</routingOrder>
<status>created</status>
<templateLocked>false</templateLocked>
<templateRequired>true</templateRequired>
<email/>
<name/>
<signInEachLocation>false</signInEachLocation>
</signer>
<signer>
<recipientId>085d8e2c-****-****-****-bdd92344e257</recipientId>
<recipientIdGuid>085d8e2c-****-****-****-bdd92344e257</recipientIdGuid>
<requireIdLookup>false</requireIdLookup><roleName>Dean</roleName>
<routingOrder>4</routingOrder>
<status>created</status>
<templateLocked>false</templateLocked>
<templateRequired>true</templateRequired>
<email/>
<name/>
<signInEachLocation>false</signInEachLocation>
</signer>
</signers>
</recipients>
答案 0 :(得分:2)
如果我尝试使用模板创建/发送信封,我可以重现此错误消息,其中模板将每个收件人角色指定为必需,但我没有指定正确/完整的收件人角色我的创建信封请求中的名称。
例如,我在DocuSign中的模板指定了两个收件人角色 - 签名者1 和签名者2 - 这两者都是必需的:
作为旁注 - 如果我为模板执行获取收件人 API请求,则响应还会显示需要两个收件人角色( templateRequired = true ) :
{
signers: [
{
signInEachLocation: "false"
name: ""
email: ""
recipientId: "f1b5d256-d85c-42d3-b081-913fb93e13a7"
recipientIdGuid: "f1b5d256-d85c-42d3-b081-913fb93e13a7"
requireIdLookup: "false"
routingOrder: "1"
roleName: "Signer1"
status: "created"
templateLocked: "false"
templateRequired: "true"
}
{
signInEachLocation: "false"
name: ""
email: ""
recipientId: "79e8bc34-6a40-4cc5-90e1-e58d9707418e"
recipientIdGuid: "79e8bc34-6a40-4cc5-90e1-e58d9707418e"
requireIdLookup: "false"
routingOrder: "2"
roleName: "Signer2"
status: "created"
templateLocked: "false"
templateRequired: "true"
}
]
agents: [ ]
editors: [ ]
intermediaries: [ ]
carbonCopies: [ ]
certifiedDeliveries: [ ]
inPersonSigners: [ ]
recipientCount: "2"
}
现在让我们假设我发送以下“从模板创建信封”API请求,并为第二个收件人使用错误的角色名称:
<envelopeDefinition xmlns="http://www.docusign.com/restapi">
<accountId>a673cd1a-***-****-****-6f4bf80e54sd</accountId>
<status>sent</status>
<templateId>3C9D42D3-3E76-4669-861E-9670415E1AD3</templateId>
<templateRoles>
<templateRole>
<email>johnsemail@outlook.com</email>
<name>John Doe</name>
<roleName>Signer1</roleName>
</templateRole>
<templateRole>
<email>janesemail@outlook.com</email>
<name>Jane Doe</name>
<roleName>RoleNameDoesntMatchWhatTheTemplateSpecifies</roleName>
</templateRole>
</templateRoles>
</envelopeDefinition>
响应包含此错误:
<errorDetails xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<errorCode>INVALID_EMAIL_ADDRESS_FOR_RECIPIENT</errorCode>
<message>The email address for the recipient is invalid. The recipient Id follows.</message>
</errorDetails>
根据此测试,我建议您验证“创建信封”API请求是否指定了模板定义的所有必需收件人角色的收件人信息,以及每个<roleName>
的值您的API请求 完全 中的收件人匹配(包括拼写和案例)模板中定义的角色名称。
**** --------更新#1 - 3/6/2014 ---------- ****
感谢您更新答案,为您遇到问题的模板添加“获取收件人”响应。该响应显示模板定义了4个收件人角色:
<roleName>Student</roleName>
<roleName>DeptHead</roleName>
<roleName>Advisor</roleName>
<roleName>Dean</roleName>
您的“从模板创建信封”请求提供4个收件人角色的信息 - 但请求中4个角色名称中的2个不正确(即,与模板定义的角色名称不匹配)。以下是您在“从模板创建信封”请求中提供的角色:
<roleName>Student</roleName>
<roleName>Advisor</roleName>
<roleName>Dept Head of Major</roleName>
<roleName>Dean of School</roleName>
要解决您遇到的错误,您需要在“从模板创建信封”请求中使角色名称与模板定义的角色名称完全匹配。即,在“从模板创建信封”请求中,您需要更改以下内容:
更改&lt; roleName&gt; 部门主管&lt; / roleName&gt;至&lt; roleName&gt; DeptHead &lt; / roleName&gt;
更改&lt; roleName&gt; 学校院长&lt; / roleName&gt;到&lt; roleName&gt; Dean &lt; / roleName&gt;
**** --------更新#2 - 3/6/2014 ---------- ****
要进一步排查问题,我建议您:
在DocuSign中编辑模板以使每个收件人角色不 - 例如,对于每个收件人角色,取消选中“发件人无法删除收件人”复选框(显示在我原来答案的第1张屏幕截图中)。在对所有四个收件人角色进行此更改后保存模板。
接下来,提交“创建信封”API请求。如果请求成功(即没有错误响应),那么这使我怀疑您的请求中的收件人信息在某种程度上与模板角色不匹配。 (即使是这种情况 - 即没有错误 - 你仍然需要找出导致问题的角色,因为即使你的API请求能够成功创建信封,它也可能只有一些四个收件人 - 不匹配的角色将从信封中删除。
接下来,找出导致问题的角色:
将模板编辑为检查“发件人无法删除收件人” 第一个角色的复选框,以及保存模板。
接下来,提交“创建信封”API请求。如果请求 成功(即没有错误响应),然后你刚刚完成的角色 要求是不导致问题的那个。如果请求 失败(即错误消息“INVALID E-Mail”),您已找到该角色 这导致了你的问题。在这种情况下,我可能会尝试删除该角色 从模板,再次将其添加回模板,然后 验证角色名称是否完全匹配(区分大小写) 您正在发送API请求,并重新尝试API请求。
返回步骤1并对模板中的下一个角色重复此过程...继续重复,直到您为所有4个角色完成这些步骤(即,再次要求所有4个角色模板)。