【发布时间】:2015-10-29 09:20:24
【问题描述】:
我正在使用 DocuSign-.NET-Client (https://github.com/docusign/DocuSign-.NET-Client) 在我的网站中集成嵌入式签名过程。
我们的工作流程是为新用户创建一个信封,然后重定向他们以签署协议。信封创建成功。但是之后当我尝试重定向到签名页面时,它会直接将我重定向到返回页面。
以下是创建信封的代码。
public static void CreateEnvelope()
{
//****** PARAMS *************************************************
string AccountEmail = "******";
string AccountPassword = "******";
string RecipientEmail = "******";
string RecipientName = "******";
string TemplateRoleName = "******";
//*****************************************************************
const string integratorKey = "*******************";
const string environment = "https://demo.docusign.net";
bool result = false;
var envelope = new Envelope();
RestSettings.Instance.IntegratorKey = integratorKey;
RestSettings.Instance.DocuSignAddress = environment;
RestSettings.Instance.WebServiceUrl = environment + "/restapi/v2";
var account = new Account
{
Email = AccountEmail,
Password = AccountPassword
};
if (!account.Login())
{
Debug.Print("Login API call failed for user {0}.\nError Code: {1}\nMessage: {2}", account.Email,
account.RestError.errorCode, account.RestError.message);
return;
}
else
{
// create envelope object and assign login info
envelope = new Envelope
{
Login = account,
TemplateId = "***********************",
TemplateRoles = new[]
{
new TemplateRole()
{
email = RecipientEmail,
name = RecipientName,
roleName = TemplateRoleName,
clientUserId = "C1E7D8B6-084A-402F-9BA8-014535D1F6C8"
}
},
EmailSubject = "Request",
Status = "sent"
};
result = envelope.Create();
if (envelope.RestError != null)
{
Debug.Print("Error code: {0}\nMessage: {1}", envelope.RestError.errorCode, envelope.RestError.message);
return;
}
bool res = envelope.GetSenderView("https://demo.docusign.net");
if (!res)
{
if (envelope.RestError != null)
{
Console.WriteLine("Error code: {0}\nMessage: {1}", envelope.RestError.errorCode, envelope.RestError.message);
return false;
}
else
{
Console.WriteLine("Error encountered retrieving signing token, please review your envelope and recipient data.");
return false;
}
}
else
{
// open the envelope's sending view
Process.Start(envelope.SenderViewUrl);
}
}
return;
}
【问题讨论】:
标签: .net client docusignapi