79328185

Date: 2025-01-04 03:27:57
Score: 1.5
Natty:
Report link

Thank you @Inbar Gazit for the response. I've come across several similar posts, but none of them provide the expected answer. Adding the complete solution for any future reference.

Below is my example template stored in DocuSign Account with some PreFillTabs added.

enter image description here

To send an envelope using Template stored on DocuSign, follow the steps below

  1. Create the Envelope using the template in "created" status in EnvelopeDefinition
EnvelopeDefinition BuildEnvelopeDefinition(string DSTemplateId)
{
    EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
    envelopeDefinition.TemplateId = DSTemplateId;
    envelopeDefinition.EmailSubject = "PreFill Tabs Test Document";
    envelopeDefinition.EmailBlurb = "PreFill Tabs Email Blurb for Testing";
    envelopeDefinition.TemplateRoles = TemplateSigner();

    envelopeDefinition.Status = "created";

    return envelopeDefinition;
}
  1. Use the DocuSign SDK/API to CreateEnvelope()
EnvelopeSummary envSummary = EnvelopesApi.CreateEnvelope(DSAccountId, env);
  1. Fetch the Tabs from the draft envelope
Tabs tabs = EnvelopesApi.GetDocumentTabs(DSAccountId, draftEnvelopeId, "1");
  1. Set the values for the PreFillTabs. The TabId is not immutable. So use the TabId from the response of the above API call to set values for it.
  2. Use the UpdateDocumentTabs to set values for the Tabs in the draftEnvelope.
EnvelopsApi.UpdateDocumentTabs(DSAccountId, draftEnvelopeId, "1", tabsVal); 
  1. Create another EnvelopeDefinition with Status as "sent"
EnvelopeDefinition envDef2 = new EnvelopeDefinition()
{
    EnvelopeId = draftEnvelopeId,
    Status = "sent"
}
  1. Use the DocuSign SDK/API to CreateEnvelope() again with the new EnvelopeDefinition(envDef2)
EnvelopeSummary envSummary2 = EnvelopesApi.CreateEnvelope(DSAccountId, envDef2);
  1. Get the Envelope Status using envSummary2.Status.
Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Inbar
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Adam