OK if you got this far means you got an email in your inbox saying document is ready to be signed.

Key problem now is how to get this document back to the database?

There is a nice thing called webhook. This give ability to DocuSign to talk back to the sender sending messages and documents once certain events happen.

How do we configure and use one?

There are two ways manual and automated. An easy way is to configure a Connect method for envelope completion status. To do this you create a Connect entity under you DocuSign admin console. This process is well documented and I will assume you will be able to handle it.

Very useful tip here for testing your webhook calls is using https://requestb.in

Here you can log you calls and make sure system is triggering them before you jump to APEX and start on implementation.

The second manual method is what we want to use for our APEX REST callbacks.Before going into details see it in action: