Skip to main content
Solved

sending envelope from a template with dynamically populating fields in a template document

  • 20 February 2018
  • 2 replies
  • 152 views

hi,

I am trying to send envelope from a template with dynamically populating fields in template document through rest API in PHP but I face a problem. I add a recipient in a template of an envelope and also I provide other recipient information in "templateRoles" in the request from the API and also I add "tabLabel" and "value" for the custom tab fields. Now after sending envelope when I check document which is to be signed in the email of both recipients then i found that recipients that added in the template from my docusign web account got the document with only basic fields (name, email, date signed and sign) and custom field values to be empty text box (no value) and when I check for the recipient that I provide through api got document with basic fields values in left sidebar which has to be manually placed in document and no custom field in sidebar and no custom field values means nothing is populate on documnet only basic fields values set in left sidebar.

For better understanding, I add my API code

$url       = "URL removed"

     $urlAuth   = array(

       "Username"=>"{docusign username}",

       "Password"=>"{docusign password}",

       "IntegratorKey"=>"{docusign integrator_id}"

       );

     $urlAuth   = json_encode($urlAuth);

     $data = array(

       "status"=>"sent",

       "emailBlurb"=>"Test Email Body",

       "emailSubject"=>"Test Email Subject",

       "templateId"=>"{template_id}",

       "templateRoles"=>array(

         array(

           "email"=>"address removed",

           "name"=>"test2 test",

           "roleName"=>"role1",

           "tabs"=>array(

             "textTabs"=>array(

               array(

                 "tabLabel"=>"adress",

                 "value"=>"geeta bhawan"

                 ),

               array(

                 "tabLabel"=>"country",

                 "value"=>"india"

                 )

               )

             )

           )

         )

       );

      

     $header = array(

         'Content-Type:application/json',

         'X-DocuSign-Authentication:'.$urlAuth,

         "cache-control:no-cache"

         );

     $dataVal = json_encode($data);

     $curl   = curl_init();

     curl_setopt($curl, CURLOPT_URL,$url);

     curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);

     curl_setopt($curl, CURLOPT_ENCODING, '');

     curl_setopt($curl, CURLOPT_MAXREDIRS, 10);

     curl_setopt($curl, CURLOPT_TIMEOUT, 30);

     curl_setopt($curl, CURLOPT_HTTP_VERSION,'CURL_HTTP_VERSION_1_1');

     curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'POST');

     curl_setopt($curl, CURLOPT_POSTFIELDS, $dataVal);

     curl_setopt($curl, CURLOPT_HTTPHEADER, $header);

     $res = curl_exec($curl);

     $err   = curl_error($curl);

     curl_close($curl);

     print_r($res); die;

Thanks

Hi, 

Welcome to the DocuSign Support Community!

The community here is for general use of DocuSign and break/fix issues. It is not for the development of integrations including API, CRM build out and customization. API and Code related questions belong in our Developer Community at (http://stackoverflow.com/tags/docusignapi/info) Stackoverflow.com . Use the #DocuSignAPI tag. Please also view our in-depth(https://www.docusign.com/developer-center)  Dev Resources .

Thank you. Donna DocuSign Support Community Moderator


Received request to sign, to my correct email address, but it’s not addressed to me. It has another name, with similar starting initials and my email. Is this a phishing scam or just a plain mistake?


Reply