title: PHP: Docusign API autopopulate tabs for template
body: <p>Objective: Autopopulate some values using the tabLabel/value key pair for server templates, using the beta <a href="https://github.com/docusign/DocuSign-PHP-Client" rel="nofollow noreferrer">Docusign PHP Client</a>. </p>
  
  <p>I've looked at quite a few stackoverflow posts and unfortunately the one that seems to be the closest related to me seems unanswered: <a href="https://stackoverflow.com/questions/26594354/docusign-api-prefilling-tab-values-on-envelope-created-from-template">Docusign API - prefilling tab values on envelope created from template</a></p>
  
  <p>I was unable to find this "SecureField" option in any sort of preferences.</p>
  
  <p>Currently, the name field fills in automatically just because of the template role being set accurately. I didn't have to do this with the tabLabel key, this was done automatically. I have tried creating a company tab, and that fails to autopopulate, so does a random text tab I have tried.</p>
  
  <p>I have currently forked the library and made it PSR-4 compatible, and to achieve this objective I changed the following files:</p>
  
  <p>TemplateRole Model: Modified the constructor to include $tabs, and set $this->tabs if $tabs is set. I added two functions getTabs()/setTabs($tabs) that behave the same as get/set RoleName, Name, Email, etc.</p>
  
  <p>RequestSignatureResource: In the foreach ($templateRoles as $templateRole) I added a 'tabs' key to the array_pusy, and put $templateRole->getTabs().</p>
  
  <p>I created a new TemplateRole('role name', 'person name', 'email', $tabs).</p>
  
  <p>I can see the tabs in the JSON request data. Is there anything I'm missing?</p>
  
  <p>I should also note that I used this post for inspiration, too: <a href="https://stackoverflow.com/questions/17600349/how-to-pre-fill-tabs-on-a-server-template-with-the-docusign-api">How to pre-fill tabs on a server template with the DocuSign API</a>. The issue with this is that if I put textTabs:{text:{tabLabel:"something", value:"some value"}} then I get a response from the API that my request was invalid. I can provide that specific error upon request if needed.</p>