I was working on a signature signing API. I decided to use docusign as a signing client. Now, most developers go through the API & never figure out how to really use it. Well, here are some ways to use the docusign API in your app. The easiest way to go about sending a document will be
- Login via the API to get a baseURI
- Create a template or get an already created templateID
- Create an envelope with the following arguments:
- a templateID
- add a templateRoles array that includes the signers, the signers method of authentication & the tabs being signed
- Status should set to sent be sent
- templateRoles array with roles and signature fields should be added to document e.g.
$e = Docusign::createEnvelope(array( 'templateId' => $templateId,
// Template ID 'emailSubject' => 'Demo Envelope Subject', // Subject of
email sent to all recipients 'status' => 'sent', // created = draft
('sent' will send the envelope!) 'templateRoles' => array( ['name' =>
'John Snow', 'email' => 'john@snow.com', 'roleName' => 'Contractor',
'clientUserId' => 1, 'tabs' => $tabs]) ));
- Get a signing URI by creating a recipientView e.g.
Docusign::createRecipientView($envelopeId, array( 'userName' => 'John Snow', 'email' => 'john@snow.com', 'AuthenticationMethod' => 'email', 'clientUserId' => 1, // Must create envelope with this ID 'returnUrl' => 'http://johnawo.com'));
- Open the uri in a new tab for signing 6. the page redirects to the returnUrl with an event parameter e.g
https://www.johnawo.com/?event=signing_complete
. You can then handle the event from your server For more information checkout [Docusign- Signing from your App]