Search code examples
docusignapi

Missing record of some successful embedded signing signatures in our db, only see 'session_timeout' in logs


Our embedded signing workflow works most of the time (I'd estimate over 95%) for the majority of our users going through our application. However, about once or twice a week we discover an individual that has successfully signed the document via DocuSign embedded signing, but our own database has no record of the signature, so we have to manually create a record in our database of the missing signature to update our application. I'm trying to debug why this happens, but I'm running out of ideas.

We rely on the returnUrl attribute of the CreateRecipientView endpoint to redirect the user back to our server, and that is when we do two very basic things that work most of the time:

  1. We record the DocuSign event to our logs table, regardless of what is returned.
  2. IF the event received is signing_complete, then we save the signature to our database.

Even if there is an error on our server processing the response and saving the signature details, our server should have already logged the raw response so we can inspect it. Given this, even if there was an error on our end, I would at least expect to see a "signing_complete" event in our logs for someone who has signed. When this particular situation occurs, the only DocuSign responses I see in our logs are viewing_complete and a few session_timeout.

Is it even possible that the user could successfully sign AND be sent back to us with a session_timeout event? Or can I be confident that a successful signature will always result in a redirect with a signing_complete event?

Anything else I should check?


Solution

  • We rely on the returnUrl attribute of the CreateRecipientView endpoint to redirect the user back to our server, and that is when we do two very basic things that work most of the time:

    You should not rely on this. It's not going to work 100% of the time. This is because relying on the client is tricky. In some situations your end-users session may not be reliable, internet loss, they hit back, they closed browser by mistake etc. There are countless of ways to account for the 5% of the "lost" envelopes.

    Instead use a Connect webhook. This approach will work 100% of the time and will be much more reliable.

    All you had to do is set up the webhook (once) and set up an endpoint, other than the one you had, to process any envelope that is complete. It's not much different than what you're doing now, but it will be more reliable.

    Webhooks even have retry mechanism, so if DocuSign can't reach your server for any reason, DocuSign will try again later.