您不能在API中使用免費試用賬戶(通過www.docusign.com創建)。您需要使用過的DocuSign開發中心
https://www.docusign.com/devcenter
另外創建了免費的開發沙盒,我不相信你正在跟蹤嵌入式簽名流的正確模式。您需要先創建信封(即DocuSign服務器端),然後才能請求籤名URL。我在您的GitHub代碼中看到您正在實例化一個信封對象,但我沒有看到實際創建一個的呼叫。
如果您在DocuSign .NET Client的根級別看Examples.cs
向下滾動到例#8你會看到它是如何已經引用現有的信封,即
//==========================================================================================
// *** Walkthrough #8 - Embedded Signing
//==========================================================================================
private void EmbeddedSigning()
{
//*****************************************************************
// ENTER VALUES FOR FOLLOWING VARIABLES!
//*****************************************************************
string AccountEmail = "***";
string AccountPassword = "***";
string EnvelopeId = "***";
string RecipientEmail = "***";
string RecipientName = "***";
//*****************************************************************
// user credentials
Account account = new Account();
account.Email = AccountEmail;
account.Password = AccountPassword;
// make the login call (retrieves your baseUrl and accountId)
bool result = account.Login();
if (!result)
{
Console.WriteLine("Login API call failed for user {0}.\nError Code: {1}\nMessage: {2}", account.Email, account.RestError.errorCode, account.RestError.message);
return;
}
// create envelope object and assign login info
Envelope envelope = new Envelope();
envelope.Login = account;
// assign the envelope id that was passed in
envelope.EnvelopeId = EnvelopeId;
// add one signer (single recipient embedded signing currently supported in DocuSign .NET Client)
envelope.Recipients = new Recipients()
{
signers = new Signer[]
{
new Signer()
{
email = RecipientEmail,
name = RecipientName,
recipientId = "1"
}
}
};
// generate the recipient view token
result = envelope.GetRecipientView("http://www.nuget.org/packages/DocuSign.Integration.Client.dll/");
if (!result)
{
if (envelope.RestError != null)
{
Console.WriteLine("Error code: {0}\nMessage: {1}", envelope.RestError.errorCode, envelope.RestError.message);
return;
}
else
{
Console.WriteLine("Error encountered retrieving signing token, please review your envelope and recipient data.");
return;
}
}
else
{
// open the recipient view (SenderViewUrl field is re-used for the recipient URL)
Process.Start(envelope.SenderViewUrl);
}
}
你有測試此您開發人員沙盒帳戶,還是通過主網站的免費試用帳戶? API請求只能用於您的開發人員沙箱,直到您驗證您的應用程序,然後您的集成商密鑰才能與任何帳戶一起使用。有關認證的更多信息,請參閱開發人員中心的上線部分。 – Ergin
是的,我正在使用免費試用帳戶,並且一切正常,直到我打電話GetRecipientView。我正在申請demo.docusign。 –
對,這就是你的問題。您無法在API中使用您的免費試用帳戶。您需要使用您通過開發人員中心創建的開發人員沙箱 – Ergin