Bronanaza
Bronanaza

Reputation: 823

How do I set the ttl on a docusign envelope URL?

I've been working on a docusign API for embedded signing, it's working great, yay. We have a version of events where we send a second docusign link via email to a second signer, and that works awesome..... within 5 minutes of sending it. I can't find a parameter to send with the API call to set the length of time it's valid to the 72 hours the business wants. What is the parameter I can change in the API call, or better yet a configuration for the account to set it appropriately?

Upvotes: 2

Views: 967

Answers (3)

Larry K
Larry K

Reputation: 49114

As the other answers say, the embedded signing TTL is fixed at 5 minutes. Here's how to handle your scenario:

Provide your signers with a URL to your application. The URL will need to include enough state so your app, when it receives URL, can determine who is the signer, what is the envelope id, whether the 72 hours has expired, etc.

Or the URL could be a ref id in your database. The your database record would hold all of the relevant information about the envelope and signer.

When the signer uses the URL, your app will be called. Your app will then look up and check the info. If all is ok, your app requests an embedded signing URL from DocuSign and then re-directs the signer to that URL. The signer then signs.

Note the "checking" issue I mention above. It is vital that you protect against people either accidentally or purposefully spoofing your system. Eg, don't use just a database record ID since someone could try random record IDs or increment a good one by one. Instead, require the URL to include both the record ID and some information on the record that can't be guessed.

Or use a random GUID as the URL's parameter and then search for it in your database.

In any case, the key is to request the embedded signing URL just before you redirect the signer to it.

Upvotes: 4

Praveen Reddy
Praveen Reddy

Reputation: 7393

You can set the notification property in your Envelope:Create api call to set the TTL for an evelope.

The TTL for an embedded signing is 5 minutes.

You can only generate recipient signing links for envelopes that are in sent status. Also note that signing links expire after 300 seconds (5 mins) and are one-time use only, meaning you need to generate a new signing token each time the recipient wants to access the envelope.

Here is a sample Request, that has an embedded and remote recipient with envelope expiration set to 72 hours.

{
    "status": "sent",
    "notification": {
        "expirations": {
            "expireAfter": 3, //Envelope Expires after 3 days (72 hours).
            "expireEnabled": true
        },
        "useAccountDefaults": false
    },
    "recipients": {
        "signers": [
            {
                "email": "[email protected]",
                "name": "signer one",
                "recipientId": 1,
                "clientUserId": 1234 //This is the embedded recipient. Does not receive an email.
            },
            {
                "email": "[email protected]",
                "name": "Co Signer",
                "recipientId": 2 //This is the remote recipeint. Receives an email.
            }
        ]
    },
    "emailSubject": "Envelope with an embedded recipient and remote recipient",
    "documents": [
        {
            "documentId": "1",
            "name": "Agreement",
            "fileExtension": "pdf",
            "documentBase64": "[Document base64 bytes go here]"
        }
    ]
}

Upvotes: 1

Frederic
Frederic

Reputation: 2065

For embedded signing, as mentioned here, URL tokens are only valid for 5 minutes.

It all lies in how you configure each signer : embedded vs remote. And the main toggle to do this is the ClientUserId property : As explained here, A non-null ClientUserId implies that user is Embedded. Hence, to set up your co-signer for remote signing, you will need to specify a ClientUserId = "".

Upvotes: 1

Related Questions