I've been reading up on the PHP DocuSign API as what I'm trying to accomplish is to pre-fill template tabs with form data so that when the user goes to sign the document, many of the fields are already complete.
I am using the following Laravel package: https://github.com/Tucker-Eric/Laravel-Docusign
This allows you to use an initialised Client
object to access the API endpoints such as:
$this->client->envelopes
$this->client->customTabs
I think I'm being stupid but I thought I'd be able to grab the custom fields, get their IDs and then populate them.
Example
// Populate the template data attributes
$templateRole = $this->client->templateRole([
'email' => 'jesseorange360@gmail.com',
'name' => 'Jesse Orange',
'role_name' => '[ROLE_NAME]',
'tabs' => [
'textTabs' => [
[
'tabLabel' => 'ApplicantName',
'value' => 'John Doe',
],
],
],
]);
// Define the DocuSign envelope
$envelopeDefinition = $this->client->envelopeDefinition([
'status' => 'sent',
'email_subject' => 'Please sign your life away.',
'template_id' => $templateId,
'template_roles' => [
$templateRole,
],
]);
// Create the DocuSign envelope
$envelopeSummary = $this->client->envelopes->createEnvelope($envelopeDefinition);
But according the API documentation you have to manually create and fill these fields like so:
https://developers.docusign.com/esign-rest-api/code-examples/set-template-tab-values
Is what I'm trying to do actually possible?