[英]How to allow multiple signer to sign same document in DocuSign
How do I add multiple signer to add sign in same document using c# web API code and start signing ceremony?如何添加多个签名者以使用 c# web API 代码在同一文档中添加签名并开始签名仪式?
I tried to do it by given below code but i's not working -我试图通过下面给出的代码来做到这一点,但我没有工作 -
DocuSign.eSign.Model.Signer signer = new DocuSign.eSign.Model.Signer();
signer.Email = recipientEmail;
signer.Name = recipientName;
signer.RecipientId = "1";
signer.ClientUserId = "1000";
signer.Tabs = new Tabs();
signer.Tabs.SignHereTabs = new List<SignHere>();
DocuSign.eSign.Model.Signer nsigner = new DocuSign.eSign.Model.Signer();
nsigner.Email = "XXX@gmail.com";
nsigner.Name = "XXX";
nsigner.RecipientId = "2";
nsigner.ClientUserId = "2000";
nsigner.Tabs = new Tabs();
nsigner.Tabs.SignHereTabs = new List<SignHere>();
for (int i = 1; i<= numberOfPages; i++)
{
SignHere signHere1 = new SignHere();
signHere1.DocumentId = "1";
signHere1.PageNumber = i.ToString();
signHere1.RecipientId = "1";
signHere1.XPosition = "450";
signHere1.YPosition = "20";
signer.Tabs.SignHereTabs.Add(signHere1);
SignHere signHere2 = new SignHere();
signHere2.DocumentId = "1";
signHere2.PageNumber = i.ToString();
signHere2.RecipientId = "1";
signHere2.XPosition = "300";
signHere2.YPosition = "30";
nsigner.Tabs.SignHereTabs.Add(signHere2);
}
envDef.Recipients = new DocuSign.eSign.Model.Recipients();
envDef.Recipients.Signers = new List<DocuSign.eSign.Model.Signer>();
envDef.Recipients.Signers.Add(signer);
envDef.Recipients.Signers.Add(nsigner);
To start the embedded signing session, I am using given below code but it's not working for remote server -要启动嵌入式签名 session,我使用下面给出的代码,但它不适用于远程服务器 -
System.Diagnostics.Process.Start("chrome.exe",recipientView.Url);
You are missing the code to make the POST API request to create a recipient view for each of the signers.您缺少发出 POST API 请求的代码,以便为每个签名者创建收件人视图。 Each such request must contain the information for the specific recipient and gives you back the URL that you can use for embedded signing.每个此类请求都必须包含特定收件人的信息,并返回您可用于嵌入式签名的 URL。 Here is an example using C# and the C# SDK:这是使用 C# 和 C# SDK 的示例:
private static RecipientViewRequest MakeRecipientViewRequest(string signerEmail, string signerName, string returnUrl, string signerClientId, string pingUrl = null)
{
// Data for this method
// signerEmail
// signerName
// dsPingUrl -- class global
// signerClientId -- class global
// dsReturnUrl -- class global
RecipientViewRequest viewRequest = new RecipientViewRequest();
// Set the url where you want the recipient to go once they are done signing
// should typically be a callback route somewhere in your app.
// The query parameter is included as an example of how
// to save/recover state information during the redirect to
// the DocuSign signing ceremony. It's usually better to use
// the session mechanism of your web framework. Query parameters
// can be changed/spoofed very easily.
viewRequest.ReturnUrl = returnUrl + "?state=123";
// How has your app authenticated the user? In addition to your app's
// authentication, you can include authenticate steps from DocuSign.
// Eg, SMS authentication
viewRequest.AuthenticationMethod = "none";
// Recipient information must match embedded recipient info
// we used to create the envelope.
viewRequest.Email = signerEmail;
viewRequest.UserName = signerName;
viewRequest.ClientUserId = signerClientId;
// DocuSign recommends that you redirect to DocuSign for the
// Signing Ceremony. There are multiple ways to save state.
// To maintain your application's session, use the pingUrl
// parameter. It causes the DocuSign Signing Ceremony web page
// (not the DocuSign server) to send pings via AJAX to your
// app,
// NOTE: The pings will only be sent if the pingUrl is an https address
if (pingUrl != null)
{
viewRequest.PingFrequency = "600"; // seconds
viewRequest.PingUrl = pingUrl; // optional setting
}
return viewRequest;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.