我正在使用SOAP API的CreateEnvelope()方法将文档上载到Draft状态的DocuSign。当我这样做然后请求发件人令牌启动嵌入式发送会话时,我会立即提示在DocuSign界面出现时应用匹配的模板。
但是,如果我没有启动嵌入式发送会话,并且用户改为登录DocuSign控制台并打开草稿信封,则不会自动提示他们应用匹配模板。他们必须手动按下“在所有文档上尝试自动模板匹配”按钮,此时会找到在嵌入发送会话中自动找到的相同模板。这种差异是否有原因?
bool retVal = true;
DocuSignService.DocuSignWS.Envelope envelope = new DocuSignService.DocuSignWS.Envelope();
if (credentials == null)
{
error = ErrorCode.NO_CREDENTIALS;
errorMessage = Strings.GetString("STR_DS_NOCREDS");
return false;
}
envelope.Documents = new DocuSignService.DocuSignWS.Document[itemList.Count];
if (credentials != null)
{
int index = 0;
foreach (Document document in itemList)
{
DocuSignService.DocuSignWS.Document doc = new DocuSignService.DocuSignWS.Document();
doc.ID = document.ID.ToString();
doc.Name = document.Name;
//get document bytes
doc.PDFBytes = document.data;
envelope.Documents[index] = doc;
index++;
}
Tab[] tabs = new DocuSignService.DocuSignWS.Tab[0];
envelope.Tabs = tabs;
envelope.Recipients = new Recipient[0];
//send?
envelope.AccountId = credentials.dsaccountid;
envelope.Subject = "Documents are ready for your signature";
envelope.EmailBlurb = "Documents are awaiting your signature.";
envelope.EnableWetSign = false;
DocuSignService.DocuSignWS.EnvelopeStatus envStatus = new DocuSignService.DocuSignWS.EnvelopeStatus();
using (ServiceWrapper client = new ServiceWrapper())
{
client.UserName = credentials.loginemail;
client.Password = credentials.loginpassword;
client.IntegratorKey = "xxx-xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx";
try
{
envStatus = client.CreateEnvelope(envelope);
}
catch (Exception e)
{
ErrorViewerWriter.Write(e);
error = ErrorCode.UPLOADFAILED;
errorMessage = e.Message;
return false;
}
}
}
return retVal;