发送多个文档以签署 DocuSign C#
Sending multiple documents to sign DocuSign C#
我将 DocuSign API 与 c# 一起使用,我正在使用方法将文档发送给多个收件人,要求签名。
public string SendDocument(string FileName, string DocumentName, DocuSignRecipient[] Recipients,
string EmailSubject = null)
{
DocuSignParams Params = MakeParams();
Params.Command = "send";
Params.FileName = FileName;
Params.DocumentName = DocumentName;
Params.Recipients = Recipients;
Params.EmailSubject = EmailSubject;
DocuSignResponse Response = RunDocuSignApp(Params);
if (!Response.Success)
throw new Exception(Response.Message);
return Response.EnvelopeId;
}
但是,如您所见,第一个参数是一个文件,所以我不能一次发送多个文件。
有什么办法吗?
谢谢。
如果您使用 C# SDK,则可以做到这一点。
我建议您先克隆我们的 C# example code
这样你就可以看到它是如何工作的。
您的场景的相关代码如下所示:(但没有 nuget 将无法工作):
EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
envelopeDefinition.EmailSubject = "请在本文件上签字";
文件 doc1 = 新文件 ();
文档 doc2 = new Document();
String doc1b64 = Convert.ToBase64String(buffer);
doc1.DocumentBase64 = doc1b64;
doc1.Name = "Lorem Ipsum"; // can be different from actual file name
doc1.FileExtension = "pdf";
doc1.DocumentId = "3";
// The order in the docs array determines the order in the envelope
envelopeDefinition.Documents = new List<Document> { doc1, doc2 };
我将 DocuSign API 与 c# 一起使用,我正在使用方法将文档发送给多个收件人,要求签名。
public string SendDocument(string FileName, string DocumentName, DocuSignRecipient[] Recipients,
string EmailSubject = null)
{
DocuSignParams Params = MakeParams();
Params.Command = "send";
Params.FileName = FileName;
Params.DocumentName = DocumentName;
Params.Recipients = Recipients;
Params.EmailSubject = EmailSubject;
DocuSignResponse Response = RunDocuSignApp(Params);
if (!Response.Success)
throw new Exception(Response.Message);
return Response.EnvelopeId;
}
但是,如您所见,第一个参数是一个文件,所以我不能一次发送多个文件。
有什么办法吗?
谢谢。
如果您使用 C# SDK,则可以做到这一点。 我建议您先克隆我们的 C# example code 这样你就可以看到它是如何工作的。 您的场景的相关代码如下所示:(但没有 nuget 将无法工作):
EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition(); envelopeDefinition.EmailSubject = "请在本文件上签字"; 文件 doc1 = 新文件 (); 文档 doc2 = new Document();
String doc1b64 = Convert.ToBase64String(buffer);
doc1.DocumentBase64 = doc1b64;
doc1.Name = "Lorem Ipsum"; // can be different from actual file name
doc1.FileExtension = "pdf";
doc1.DocumentId = "3";
// The order in the docs array determines the order in the envelope
envelopeDefinition.Documents = new List<Document> { doc1, doc2 };