Jimmy Xu
Jimmy Xu

Reputation: 35

How to get envelope link

In my application, after user register, it creates a docusign document and send in an envelope to user's email for signature.

My question is how do I also provide a link to the document from my application? I want it to be the same link that user would access in their email. I have tried to construct url from envelope_id which i get from the result of create_envelope, but that seems to be wrong. Is there actually a way to do this? Or the it has to be accessed from user's email?

An envelope uri: envelopes/ids

Upvotes: 2

Views: 1877

Answers (1)

Matthew Roknich
Matthew Roknich

Reputation: 908

The flow you might be looking for is called Embedded Signing. With embedded signing, you can redirect your users to sign DocuSign envelopes instead of having them sign via email.

Two steps process:

First, you will create your envelope. Be sure to include clientUserId for each recipient object. This will be used when you want to generate unique signing URLs in the next step.

POST /accounts/{accountId}/envelopes
{
    "status": "sent",
    "emailSubject": "Envelope with Embedded Signer",
    "documents": [{
        "documentId": "1",
        "name": "contract.pdf",
        "documentBase64": "base64 document bytes...",
    }],
    "recipients": {
        "signers": [{
            "email": "[email protected]",
            "name": "John Doe",
            "recipientId": "1",
            "clientUserId": "1234"
        }]
    }
}

Second, you will generate the RecipientViewURL for a given user.

POST /accounts/{accountId}/envelopes/{envelopeId}/views/recipient
{
    "userName": "John Doe",
    "email": "[email protected]",
    "recipientId": "1",
    "clientUserId": "1234",
    "authenticationMethod": "email",
    "returnUrl": "https://www.docusign.com/devcenter"
}

Here is a guide that provides a more thorough background on the feature.

Upvotes: 2

Related Questions