Download Signed Documents

Snapdocs Connect allows the broadcast the event of signed documents being available to the lender through subscriptions and webhooks. Snapdocs sends webhooks to programmatically inform you about the progress of your closings, such as closing status, eSigning status, etc.

In this guide, we'll walk you through how to set up the document.created webhook so that you can be notified when signed documents of a closing are ready for download. You can also reference the below diagram for the steps to subscribe to events and retrieve signed documents.

1962

Step 1: Create a webhook listener

Create a webhook listener (or HTTP API) to receive the document.created event from Snapdocs Connect. You’ll use the URL for the listener webhook_url in the next step.

Step 2: Create a subscription to the document.created event

Make a POST request to the Create a subscription endpoint to register the webhook URL and the "document.created" event.

With this subscription, after the signed documents have been uploaded to Snapdocs, we will send a notification to the webhook listener.

Step 3: Handle the event payload

The document.created event is triggered when either eSigned documents or wet signed documents return to Snapdocs. Therefore, your integration must check the document_type field in the payload to decide the next steps.

In the example payload below, we can identify wet-signed documents in the payload by their document_type, which is scanback_documents.

📘

See Documents for more information about document types.

The event payload from Snapdocs Connect contains the following information:

{
   "event_id":"572f592a-fbec-49d9-a28a-88d8e38175be",
   "closing_uuid":"23e4567-e89b-12d3-a456-426614174000",
   "event_name":"document.created",
   "document_uuid":"cfdc4924-86a5-4353-8ec3-26368b9157c4",
   "document_type":"scanback_documents",
   "created_at":1618936005,
   "payload":{
      "external_identifiers":[
         {
            "external_system":"other_los",
            "external_type":"file_number",
            "value":"1234"
         }
      ],
      "document_uuid":"cfdc4924-86a5-4353-8ec3-26368b9157c4",
      "document_type":"scanback_documents"
   }
}

Here’s how a client application can check the document_type and decide the next steps.

if event_body.get('event_name') == 'document.created':
  if event_body.get('document_type') == 'scanback_documents':
    download_scanback_document(event_body.get('closing_uuid'), event_body.get('document_uuid'))
  else:
    pass

Step 4: Download signed documents

a. Enable your LOS to download and store signed document files.

b. Make a GET request to the Download a document endpoint to download the signed documents.