2016-07-04 12 views
0

DocuSign 타사를 사용하여 POC를 수행하고 있습니까? { "의 errorCode": "PARTNER_AUTHENTICATION_FAILED" "메시지"오류 메시지가CreateEnvelope를 호출하는 중 오류가 발생했습니다.

오류를 얻고, 전화 CreateEnvelope을 만들거나 봉투를 전송하는 동안, 몇 가지 문제에 직면하고 있는가 "지정된 통합 키가 발견되거나 비활성화되지 않았습니다 Integrator 키가 지정되지 않았습니다. " }

이메일 ID 또는 비밀번호를 입력하지 않아 보안상의 이유로 아래 코드를 인증 할 수 있습니다.

private string DocLogin() 
{ 
    string accountId = null; 
    try 
    { 
     ApiClient apiClient = new ApiClient("https://demo.docusign.net/restapi"); 
     Configuration cfi = new Configuration(apiClient); 
     string authHeader = "{\"Username\":\"" + username + "\", \"Password\":\"" + password + "\", \"IntegratorKey\":\"" + integratorKey + "\"}"; 
     cfi.AddDefaultHeader("X-DocuSign-Authentication", authHeader); 
     AuthenticationApi authApi = new AuthenticationApi(cfi); 
     LoginInformation loginInfo = authApi.Login(); 
     accountId = loginInfo.LoginAccounts[0].AccountId; 
    } 
    catch (Exception ex) 
    { 
     string inner = ex.Message; 
    } 
    return accountId; 
} 

코드에서 인증 후 accountid가 표시됩니다.

private void CreateSendEnvelope(string accountID) 
{ 
    string pdfPath = Server.MapPath("~/PDF/pdf-sample.pdf"); 
    if (!string.IsNullOrEmpty(accountID)) 
    { 
     if (System.IO.File.Exists(pdfPath)) 
     { 
      byte[] fileBytes = System.IO.File.ReadAllBytes(pdfPath); 
      EnvelopeDefinition envDef = new EnvelopeDefinition(); 
      envDef.EmailSubject = "[DocuSign C# SDK] - Please sign this doc"; 
      Document doc = new Document(); 
      doc.DocumentBase64 = System.Convert.ToBase64String(fileBytes); 
      doc.Name = "img003.pdf"; 
      doc.DocumentId = "1"; 
      envDef.Documents = new List<Document>(); 
      envDef.Documents.Add(doc); 

      Signer signer = new Signer(); 
      signer.Email = "[email protected]"; 
      signer.Name = "Test"; 
      signer.RecipientId = "1"; 
      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 = "100"; 
      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"; 
      //envDef.Status = "created"; 

      // |EnvelopesApi| contains methods related to creating and sending Envelopes (aka signature requests) 
      EnvelopesApi envelopesApi = new EnvelopesApi(); 
      EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(accountID, envDef); 

      // print the JSON response 
      Console.WriteLine("EnvelopeSummary:\n{0}", JsonConvert.SerializeObject(envelopeSummary)); 

      //APIServiceSoapClient apiService = new APIServiceSoapClient(); 
      //return envelopeSummary; 
     } 
    } 
} 

위의 코드에서 내가 언급 한 것처럼 예외가 발생합니다. 이것 좀 도와주세요.

답변

1

CreateSendEnvelope를 호출하기 전에 DocLogin 메서드를 즉시 호출하고 있습니까? 봉투를 만들 때까지 로그인이 만료 된 것 같습니다. CreateSendEnvelope에서 login 메소드를 호출하고 그 결과를 확인하십시오.

+0

이것은 독립 실행 형 답변 대신 나에게 댓글을 더 닮았습니다. – Andrej

+0

내 평판 수준 때문에 다른 사람의 질문에 의견을 말할 수 없습니다 ... –

+0

그래, 미안해. 조만간 명성을 얻길 바랍니다. :) – Andrej

관련 문제