DocuSign 데모 계정을 사용하여 C#을 사용하여 클라이언트에 서명하기위한 전자 메일로 문서를 보냅니다. 나는이 링크 (https://www.docusign.com/developer-center/api-overview#quickstart)의 코드를 사용하고있다. 하지만 코드를 실행하면 클라이언트에게 전자 메일이 전송되지 않고 오류도 표시되지 않습니다. 또한 HttpWebRequest 및 ajax 사용하여 봉투 함께 인증 후에 반환하는 baseurl 게시 시도했다. 그것은 역시 운동하지 않았다. 아무도 이것으로 나를 도울 수 있습니까?DocuSign (클라이언트에 전자 메일 보내기) ASP.NET MVC
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
Newtonsoft.Json;
DocuSign.eSign.Api를 사용합니다.
DocuSign.eSign.Model;
DocuSign.eSign.Client;
네임 스페이스 DocuSignTest {
class Program
{
static void Main(string[] args)
{
try
{
// Enter your DocuSign credentials
string Username = "[email protected]";
string Password = "******";
string IntegratorKey = "****************";
// specify the document we want signed
string SignTest1File = @"C://SamplePdfSign.pdf";
// Enter recipient (signer) name and email address
string recipientName = "PPradeep";
string recipientEmail = "*****************";
// instantiate api client with appropriate environment
string basePath = "https://demo.docusign.net/restapi";
// instantiate a new api client
ApiClient apiClient = new ApiClient(basePath);
// set client in global config so we don't need to pass it to each API object
Configuration.Default.ApiClient = apiClient;
string authHeader = "{\"Username\":\"" + Username + "\", \"Password\":\"" + Password + "\", \"IntegratorKey\":\"" + IntegratorKey + "\"}";
Configuration.Default.AddDefaultHeader("X-DocuSign-Authentication", authHeader);
// we will retrieve this from the login() results
string accountId = null;
AuthenticationApi authApi = new AuthenticationApi();
LoginInformation loginInfo = authApi.Login();
accountId = loginInfo.LoginAccounts[0].AccountId;
Console.WriteLine("LoginInformation: {0}", loginInfo.ToJson());
// Read a file from disk to use as a document
byte[] fileBytes = File.ReadAllBytes(SignTest1File);
EnvelopeDefinition envDef = new EnvelopeDefinition();
envDef.EmailSubject = "[DocuSign C# SDK] - Please sign this doc";
// Add a document to the envelope
Document doc = new Document();
doc.DocumentBase64 = System.Convert.ToBase64String(fileBytes);
doc.Name = "TestFile.pdf";
doc.DocumentId = "1";
envDef.Documents = new List<Document>();
envDef.Documents.Add(doc);
// Add a recipient to sign the documeent
Signer signer = new Signer();
signer.Name = recipientName;
signer.Email = recipientEmail;
signer.RecipientId = "1";
// must set |clientUserId| to embed the recipient
signer.ClientUserId = "1234";
// Create a |SignHere| tab somewhere on the document for the recipient to sign
signer.Tabs = new Tabs();
signer.Tabs.SignHereTabs = new List<SignHere>();
SignHere signHere = new SignHere();
signHere.DocumentId = "1";
signHere.PageNumber = "1";
signHere.RecipientId = "1";
signHere.XPosition = "100";
signHere.YPosition = "150";
signer.Tabs.SignHereTabs.Add(signHere);
envDef.Recipients = new Recipients();
envDef.Recipients.Signers = new List<Signer>();
envDef.Recipients.Signers.Add(signer);
// set envelope status to "sent" to immediately send the signature request
envDef.Status = "sent";
// Use the EnvelopesApi to create and send the signature request
EnvelopesApi envelopesApi = new EnvelopesApi();
EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountId, envDef);
Console.WriteLine("EnvelopeSummary:\n{0}", JsonConvert.SerializeObject(envelopeSummary));
} //try
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.ReadKey();
}
}
}
난 당신이-주석 (또는 모두 제거) 코드에서이 줄을하는 것이 좋을 것
코드는 어떻게됩니까? 귀하의 코드가 문서와 일치한다는 것을 어떻게 알 수 있습니까? 질문에 관련 '코드'를 추가하십시오. – 12seconds
생성 된 JSON 요청을 공유 할 수 있습니까? https://support.docusign.com/guides/ndse-user-guide-api-request-logging에 따라 DS에서 API 로깅을 캡처 할 수 있습니다. 내 이해는 당신이 원격 서명 대신 임베디드 서명을 사용하고있는 것일 수 있습니다. DocuSign은 임베디드 서명을위한 전자 메일을 생성하지 않습니다. 서명자에 대한 json 요청에 clientuserId를 추가 한 경우 임베디드 서명을 호출합니다. –
게시 한 코드를 확인하십시오. 답장을 보내 주셔서 감사합니다. –