Closed esukmonica closed 1 year ago
Did you create the signHere tab while you create the envelope? The recipientView API only creates the URL for embedded signing. It does not update or remove the tabs in the envelope that is already created.
Hi,
Yes, I did. And the user does get the "Sign Here" tab when the envelope is first created. Please see below the MakeEnvelope method:
public static EnvelopeDefinition MakeEnvelope(DSInfo settings)
{
// Data for this method
// signerEmail
// signerName
// signerClientId Including a client user ID automatically specifies the signer as embedded (using your app)
// Config.docPdf
byte[] buffer = settings.DocumentToSign;
EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
envelopeDefinition.EmailSubject = settings.EmailSubject;
DocuSign.eSign.Model.Document doc1 = new DocuSign.eSign.Model.Document();
string doc1b64 = Convert.ToBase64String(buffer);
doc1.DocumentBase64 = doc1b64;
doc1.Name = settings.DocumentTitle; // can be different from actual file name
doc1.FileExtension = settings.DocumentExtension;
doc1.DocumentId = "1";
// The order in the docs array determines the order in the envelope
envelopeDefinition.Documents = new List<DocuSign.eSign.Model.Document> { doc1 };
// Create a signer recipient to sign the document, identified by name and email
// We set the clientUserId to enable embedded signing for the recipient
// We're setting the parameters via the object creation
Signer signer1 = new Signer
{
Email = settings.SignerEmail,
Name = settings.SignerFullName,
ClientUserId = settings.SignerClientUserId,
RecipientId = "1",
};
// Create signHere fields (also known as tabs) on the documents,
// We're using anchor (autoPlace) positioning
//
// The DocuSign platform searches throughout your envelope's
// documents for matching anchor strings.
SignHere signHere1 = new SignHere
{
AnchorString = "/sn1/",
AnchorUnits = "pixels",
AnchorXOffset = "10",
AnchorYOffset = "20",
};
// Tabs are set per recipient / signer
Tabs signer1Tabs = new Tabs
{
SignHereTabs = new List<SignHere> { signHere1 },
};
signer1.Tabs = signer1Tabs;
// Add the recipient to the envelope object
Recipients recipients = new Recipients
{
Signers = new List<Signer> { signer1 },
};
envelopeDefinition.Recipients = recipients;
// Request that the envelope be sent by setting |status| to "sent".
// To request that the envelope be created as a draft, set to "created"
envelopeDefinition.Status = "sent";
return envelopeDefinition;
}
`
I found the problem, when recreating the signing URL, I was passing NULL in the signer client user id
{
RecipientViewRequest viewOptions = new RecipientViewRequest()
{
ReturnUrl = settings.DSReturnUrl,
ClientUserId = settings.SignerClientUserId, <--- THIS WAS NULL
AuthenticationMethod = "email",
UserName = settings.SignerFullName,
Email =settings.SignerEmail
};
All working now. Thanks!
And one quick question, here is the scenario
NOTE: there is only one person signing the document
Glad to hear that you've solved the issue! Regarding another question, yes, you can update the document in the envelope with the updateDocument API: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopedocuments/update/
Brilliant, thanks
Hi,
I have implemented embedded signing. However, the user might do a "finish later", so I am storing the user signing details at that point as per: https://www.docusign.com/blog/developers/long-lived-embedded-signing-urls
Now, the user is back and I am "recreating" a docusign sign URL to the existing envelope. The problem is that the "Sign HERE" is gone from the document.