2017-07-03 9 views
-1

タグは、私が埋め込まれた署名にDocuSignのを統合していますテンプレート

``code`  DocuSignTK.Recipient recipient = new DocuSignTK.Recipient(); 
 
     recipient.Email = signer_email; // This person will use embedded signing. If you have his 
 
      // email, supply it. If you don't, use a fake email that includes your 
 
      // ClientUserID. Eg embedded_signer_{ClientUserID}@your_company.com 
 
     recipient.UserName = signer_name; 
 
     recipient.ID = 1; 
 
     recipient.Type_x = 'Signer'; 
 
     recipient.RoutingOrder = 1; 
 
     recipient.RoleName = 'Signer1';   
 
     // We want this signer to be "captive" so we can use embedded signing with him 
 
     recipient.CaptiveInfo = new DocuSignTK.RecipientCaptiveInfo(); 
 
     recipient.CaptiveInfo.ClientUserID = signer_user_id; // Must uniquely identify the    
 

 
     // Create the recipient information   
 
     DocuSignTK.ArrayOfRecipient1 recipients = new DocuSignTK.ArrayOfRecipient1(); 
 
     recipients.Recipient = new DocuSignTK.Recipient[1]; 
 
     recipients.Recipient[0] = recipient; 
 
     
 
     DocuSignTK.ArrayOfTemplateReferenceRoleAssignment Roles = new DocuSignTK.ArrayOfTemplateReferenceRoleAssignment(); 
 
     Roles.RoleAssignment = new DocuSignTK.TemplateReferenceRoleAssignment[1]; 
 
     DocuSignTK.TemplateReferenceRoleAssignment role = new DocuSignTK.TemplateReferenceRoleAssignment(); 
 
     role.RoleName = 'Signer1'; 
 
     role.RecipientID = 1; 
 
     Roles.RoleAssignment[0] = role;   
 
     
 
     // Create the template reference from a server-side template ID 
 
     DocuSignTK.TemplateReference templateReference = new DocuSignTK.TemplateReference(); 
 
     templateReference.Template = 'd0d80082-612b-4a04-b2a1-0672eb720491'; 
 
     templateReference.TemplateLocation = 'Server'; 
 
     
 
     
 
     templateReference.RoleAssignments = Roles; 
 
     
 
     // Construct the envelope information 
 
     DocuSignTK.EnvelopeInformation envelopeInfo = new DocuSignTK.EnvelopeInformation(); 
 
     envelopeInfo.AccountId = account_Id; 
 
     envelopeInfo.Subject = 'Subject'; 
 
     envelopeInfo.EmailBlurb = 'Email content';   
 

 
     // Make the call 
 
     try { 
 
      //DocuSignTK.EnvelopeStatus result = api_sender.CreateAndSendEnvelope(envelope); 
 
      // Create draft with all the template information 
 
      DocuSignTK.ArrayOfTemplateReference TemplateReferenceArray = new DocuSignTK.ArrayOfTemplateReference(); 
 
      TemplateReferenceArray.TemplateReference = new DocuSignTK.TemplateReference[1]; 
 
      TemplateReferenceArray.TemplateReference[0] = templateReference; 
 
      DocuSignTK.EnvelopeStatus result = api_sender.CreateEnvelopeFromTemplates(TemplateReferenceArray, recipients, envelopeInfo, true); 
 
      envelope_id = result.EnvelopeID; 
 
      System.debug('Returned successfully, envelope_id = ' + envelope_id); 
 
     } catch (CalloutException e) { 
 
      System.debug('Exception - ' + e); 
 
      error_code = 'Problem: ' + e; 
 
      error_message = error_code; 
 
     } `code``

を使用して埋め込まれた署名のドキュメントの左側に表示されています。私はSOAP APIを使用しており、メソッドCreateEnvelopeFromTemplatesを使用しています。私が作成したテンプレートにはいくつかのフィールド/タブがあります。しかし、いったん署名するURLを開くと、これらのフィールドは、テンプレートで送信した場所ではなく、ドキュメントの横に配置されます。

受信者の役割名も割り当てられていますが、機能していません。助けてください。ここで

Click here to see screenshot

+0

コードをお知らせください。 –

+0

あなたのコードはおそらくタブを指定していないので、DocuSignフリーフォームのサインパネルが表示されています。 https://www.docusign.com/blog/quick-tip-tuesday-guided-signing-versus-free-form-signing/ –

+0

@CodingDawg - 返信いただきありがとうございます。上記のコードを追加しました。私の前提は、CreateEnvelopeFromTemplatesが自動的にテンプレートに指定されたタブを表示するということでした。このメソッドがそうしない場合、これらのタブをどこに追加すればよいですか?私はこれのための関連コードは見つかりませんでした。 – Rahul

答えて

-1

は、私は、生産からテンプレートをダウンロードし、サンドボックス内でアップロードされたが、私は唯一のサンドボックスに似たテンプレートを再作成し、使用したら、それはそれは完璧に働いているコード内のテンプレートIDです。どうやら、Docusignのインポートテンプレートユーティリティに問題があるようです。

1

DocuSignののSOAP APIを使用してテンプレートから封筒を作成するためのC#コードです。ドキュメントhere

 string apiUrl = "https://demo.docusign.net/api/3.0/api.asmx"; 
     string accountId = "Enter accountId"; // 
     string email = "Enter email"; 
     string userName = "Enter intergrator key"; 

     userName += email; 
     string _password = "Enter password"; 
     var apiClient = new DocuSignTK.APIServiceSoapClient("APIServiceSoap", apiUrl); 
     apiClient.ClientCredentials.UserName.UserName = userName; 
     apiClient.ClientCredentials.UserName.Password = _password; 

     // Construct all the recipient information 
     var recipients = new DocuSignTK.Recipient[1]; 

     recipients[0] = new DocuSignTK.Recipient(); 
     recipients[0].Email = "[email protected]"; 
     recipients[0].UserName = "recipient one"; 
     recipients[0].Type = DocuSignTK.RecipientTypeCode.Signer; 
     recipients[0].ID = "1"; 
     recipients[0].RoutingOrder = 1; 
     recipients[0].RoleName = "Signer1"; 

     var roles = new DocuSignTK.TemplateReferenceRoleAssignment[1]; 
     roles[0] = new DocuSignTK.TemplateReferenceRoleAssignment(); 
     roles[0].RoleName = recipients[0].RoleName; 
     roles[0].RecipientID = recipients[0].ID; 

     // Use a server-side template -- you could make more than one of these 
     var templateReference = new DocuSignTK.TemplateReference(); 
     templateReference.TemplateLocation = DocuSignTK.TemplateLocationCode.Server; 
     // TODO: replace with template ID from your account 
     templateReference.Template = "d0d80082-612b-4a04-b2a1-0672eb720491"; 
     templateReference.RoleAssignments = roles; 

     // Construct the envelope information 
     DocuSignTK.EnvelopeInformation envelopeInfo = new DocuSignTK.EnvelopeInformation(); 
     envelopeInfo.AccountId = " "; 
     envelopeInfo.Subject = "create envelope from templates test"; 
     envelopeInfo.EmailBlurb = "testing docusign creation services"; 

     // Create draft with all the template information 
     DocuSignTK.EnvelopeStatus status = apiClient.CreateEnvelopeFromTemplates(new DocuSignTK.TemplateReference[] { templateReference }, 
      recipients, envelopeInfo, false); 
関連する問題