0
votes

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?

1

1 Answers

0
votes

You can pre-fill tabs in a template. You have to make sure that you match the recipient information for the tabs to the information on the template. The example you showed creates the tabs, later, so that's a different way of doing it. There's a question that was just recently asked with a similar challenge someone had: Custom Tabs shared with all Signers in DocuSign So, ensure that the recipients information match, because tabs are defined per-recipient and you should be able to update their values.