Laravel Connection to Docusign php example

Docusign php example
I will show in the following post , How to integrate the PHP with Docusign. We will be using the Laravel and Docusign integration.

DocuSign uses to send the document to customers and let them sign. It’s an easy way to get them signed and secure documents/contracts over the internet.

The easier way to connect the Laravel application to DcosSign is via Esign – REST API. If you want to connect Laravel to DocuSign without going in OAuth and permission.

Include in your application. The package is old but it works.


Step 1 : <installation>

Install Through Composer

After updating composer, add the service provider to the providers array in config/app.php

Add the facade to the aliases array in config/app.php

Generate the config file:

Add the following to your .env file (matching the config):

You need integration key for put in DOCUSIGN_INTEGRATOR_KEY Option for that go to  and go the sidebar menu API KEY.

Follow the procedure and generate an API Key. Use the authorization grant as the user application type and leave everything blank after that.

Step 2 : <Configuration>

Before going on with this step, first understand, what we are going to do? There are three ways to create a dynamic field PDF in Docusign.

1 : Upload PDF in DocuSign and send the envelop straight away with signature field.

2: Upload PDF with empty filed PDF and you will enter that filed via API

2: Upload PDF with empty field PDF with custom filed  placeholder and enter the field  via API


The first way only works, when you are sending the document only to be signed and you already have all fields predefined.

The second way is a more dynamic way in which you don’t have.

The second way only works, when you don’t have control over dynamic fields, Like you don’t know what input parameters you’re going to fill in the PDF. 


The third way is the way, which most of the services are using.

Above you can see the screenshot of the dynamic placeholder inside Docusign. We can create placeholders in template blank placeholders.


So let’s start -> Creating a third type of template.

docusign php example

We are creating the above form in Docusign with name, email, phone_number, and signature fields.

We have to upload this to Docusign first.



Click New -> Create Template

Simply upload you blank template there and put name and description


Afterward, just put the following parameters

The role put “user_client”  role filed will be helpful when we interact with this template via API


Click Next

Now in this step, we have to create the custom fields which later can be filed via API.


Click on the gear icon 


You will go to the custom fields


Create custom fields for name, email, and phone number and drag it token in fields. Remember while creating custom notes down the name of the field, it will help in API.


Similarly, drag the signature field from the standard filed tab

Afterward just save and close this template .before closing note down the template ID like this “f469638d-3522-43c7-9cf7-789acce3d55f”  from URL


Step 2 : <API>


Following code to send the request to the API to send the client the custom PDF and sign.

The above code will send the PDF to the client for the sign. I have commented on the code, You can understand easily.


In the next article, I will show you. How to get a notification and signed PDF via API.

Next Article

Laravel Connection to Docusign php example – Part 2




10 thoughts on “Laravel Connection to Docusign php example”

  1. Thanks for the article which you have posted for larval docusign api integration which will be helpful for us integration.
    Can u please share the article and document url which u have created for the notification and signed PDF via API.webhook function for notification when the document get signed.

  2. Dear Admin,

    while trying to foollow the integration , i noticed that you site has been hacked , i guess. ( phishing redirecion )

    Our browser is showing an alert.



Leave a comment