Question

I have successfully integrated my company's system with DocuSign using DocuSign's SOAP API. I can send, check status and retrieve Envelopes through the SOAP interface.

I have read that the preferred method of getting Envelope status is through an event. Unfortunately I haven't had any luck finding an example of this.

I found some documentation about it HERE.

Has anyone used this way of event / notification from DocuSign that would help point me in the right direction?

Was it helpful?

Solution

There are examples of it on DocuSign's own Lithium forums (which will be made read-only soon) in PHP for example. They're pretty easy to setup, you just need a server listening for the events with the rights ports open and you just add the eventNotification element to your request. You've referenced the SOAP api guide, which the sample PHP code below shows how to implement. There's also a version available for REST API.

You can download DocuSign's SOAP SDK out of GitHub and there's sample PHP project ready of out of the box for you to start modifying and adding in eventNotifications.

// Notifications
$eventNoti = new EventNotification();
$eventNoti->URL = 'http://myurl.com/docusign/updateDocStatus'.$env_id.'/';
$eventNoti->LoggingEnabled = "TRUE";

// Important Stuff below
$envEvent = new EnvelopeEvent();
$envEvent->EnvelopeEventStatusCode = "Completed";  // <---------- Fires on "Completed" only
$envEvent->IncludeDocuments = "TRUE";
$eventNoti->EnvelopeEvents = array($envEvent); // <------------ Add multiple EnvelopeEvent's
$envInfo->EventNotification = $eventNoti;

This link is where the above code is referenced from, along with further discussion that might help.

Another option is to use the DocuSign Connect module to push events to your external listener. The main difference between DocuSign Connect and the eventNotification is that eventNotification is per envelope, Connect is account wide and or user-wide.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top