Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I setup a web hook to check on DocuSign Envelope status?

Tags:

docusignapi

I have the code written which is using envelopes to request a signature from the client like in this tutorial:

https://www.docusign.com/developer-center/recipes/request-a-signature-via-email-using-a-template

My question is, how can I define a web hook URL which can be used to update the envelope's status? I would like to be notified and to be able to update the envelope status in my database once the client signs the documents. Is this possible?

Does EnvelopeDefinition class expose some property which allows me to define the web hook's url?

like image 318
Marko Avatar asked Dec 10 '22 16:12

Marko


1 Answers

Updated

We now have new series of recommended WebHook code examples which use serverless functions and cloud-based reliable queuing services. These example enable you to receive and process the DocuSign webhook notifications inside your firewall with no changes to your filewall.

Examples are available now for Node. Examples for C#, Java, PHP, and Python are being written.

  • AWS listener and worker Node.js examples
  • Azure listener and worker Node.js examples
  • Google Cloud listener and worker Node.js examples

The format of the webhook XML messages is documented.

Note The Connect guide (March, 2016 date on page 2) is old, and is incorrect in many cases. A new guide is in production. This guide is useful for the XML format information.

WSDL file, including the notification messages format is available.

To see the XML messages that are returned, here's a sample notification for a completed envelope:

<?xml version="1.0" encoding="utf-8"?>
<DocuSignEnvelopeInformation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.docusign.net/API/3.0">
<EnvelopeStatus>
    <RecipientStatuses>
    <RecipientStatus>
        <Type>Signer</Type>
        <Email>[email protected]</Email>
        <UserName>Signer's name</UserName>
        <RoutingOrder>1</RoutingOrder>
        <Sent>2020-05-23T12:43:07.22</Sent>
        <Delivered>2020-05-23T12:43:14.767</Delivered>
        <Signed>2020-05-23T12:43:18.22</Signed>
        <DeclineReason xsi:nil="true"/>
        <Status>Completed</Status>
        <RecipientIPAddress>141.226.182.70</RecipientIPAddress>
        <ClientUserId>1000</ClientUserId>
        <CustomFields/>
        <TabStatuses>
        <TabStatus>
            <TabType>SignHere</TabType>
            <Status>Signed</Status>
            <XPosition>427</XPosition>
            <YPosition>531</YPosition>
            <TabLabel>Sign Here</TabLabel>
            <TabName>SignHere</TabName>
            <TabValue/>
            <DocumentID>1</DocumentID>
            <PageNumber>1</PageNumber>
        </TabStatus>
        </TabStatuses>
        <AccountStatus>Active</AccountStatus>
        <RecipientId>56e11847-da17-43c3-95f6-d4b675af8621</RecipientId>
    </RecipientStatus>
    </RecipientStatuses>
    <TimeGenerated>2020-05-23T12:43:38.7282968</TimeGenerated>
    <EnvelopeID>cd67ff4a-6cb1-42f3-87d3-f7c149031549</EnvelopeID>
    <Subject>Please sign the attached document</Subject>
    <UserName>Larry Kluger</UserName>
    <Email>[email protected]</Email>
    <Status>Completed</Status>
    <Created>2020-05-23T12:43:06.753</Created>
    <Sent>2020-05-23T12:43:07.253</Sent>
    <Delivered>2020-05-23T12:43:14.83</Delivered>
    <Signed>2020-05-23T12:43:18.22</Signed>
    <Completed>2020-05-23T12:43:18.22</Completed>
    <ACStatus>Original</ACStatus>
    <ACStatusDate>2020-05-23T12:43:06.753</ACStatusDate>
    <ACHolder>Larry Kluger</ACHolder>
    <ACHolderEmail>[email protected]</ACHolderEmail>
    <ACHolderLocation>DocuSign</ACHolderLocation>
    <SigningLocation>Online</SigningLocation>
    <SenderIPAddress>208.113.165.37 </SenderIPAddress>
    <EnvelopePDFHash/>
    <CustomFields>
    <CustomField>
        <Name>Team</Name>
        <Show>True</Show>
        <Required>False</Required>
        <Value/>
    </CustomField>
    <CustomField>
        <Name>Office</Name>
        <Show>True</Show>
        <Required>False</Required>
        <Value/>
    </CustomField>
    <CustomField>
        <Name>Order ID</Name>
        <Show>True</Show>
        <Required>False</Required>
        <Value/>
    </CustomField>
    <CustomField>
        <Name>AccountId</Name>
        <Show>false</Show>
        <Required>false</Required>
        <Value>4197223</Value>
        <CustomFieldType>Text</CustomFieldType>
    </CustomField>
    <CustomField>
        <Name>AccountName</Name>
        <Show>false</Show>
        <Required>false</Required>
        <Value>World Wide Corp</Value>
        <CustomFieldType>Text</CustomFieldType>
    </CustomField>
    <CustomField>
        <Name>AccountSite</Name>
        <Show>false</Show>
        <Required>false</Required>
        <Value>demo</Value>
        <CustomFieldType>Text</CustomFieldType>
    </CustomField>
    </CustomFields>
    <AutoNavigation>true</AutoNavigation>
    <EnvelopeIdStamping>true</EnvelopeIdStamping>
    <AuthoritativeCopy>false</AuthoritativeCopy>
    <DocumentStatuses>
    <DocumentStatus>
        <ID>1</ID>
        <Name>Example document</Name>
        <TemplateName/>
        <Sequence>1</Sequence>
    </DocumentStatus>
    </DocumentStatuses>
</EnvelopeStatus>
<TimeZone>Pacific Standard Time</TimeZone>
<TimeZoneOffset>-7</TimeZoneOffset>
</DocuSignEnvelopeInformation>
like image 162
Larry K Avatar answered Jan 18 '23 23:01

Larry K