在DocuSign中的模板上预填充选项卡

我正在使用从DocuSign开发页面链接的C#JWT-framework.sln。

我的API在演示环境中运行,我可以执行以下各项:

  1. 发送带有签名块位置控制位置的信封。
  2. 发送信封并动态添加选项卡,并为这些选项卡定位和设置值。
  3. 检索已经签收的信封。
  4. 使用预定义的模板发送信封。

以下代码使用我的模板生成了一个信封...但是我无法忍受我的生命,想出如何获取模板中存在的选项卡对象的列表,以便在路由之前先用数据预先填充它们签名信封。

EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition
        {
            EmailSubject = "Please sign this test document"
        };

        envelopeDefinition.TemplateId = "5a56ee22-91dd-443e-85f4-bd43b446db5b";

我以为我需要使用TemplateTabs类,但是我无法找到任何有关如何循环浏览模板上所有选项卡,然后根据选项卡ID更新特定选项卡的示例。

任何帮助,将不胜感激。

谢谢 限界

评论
一个人的伤悲
一个人的伤悲

We have a code example showing you how to do this.

(当然,您的模板是不同的,只是为了给您一个想法)

The C# relevant snippet is here:

 // Set the values for the fields in the template
        // List item
        List colorPicker = new List
        {
            Value = "green",
            DocumentId = "1",
            PageNumber = "1",
            TabLabel = "list"
        };

        // Checkboxes
        Checkbox ckAuthorization = new Checkbox
        {
            TabLabel = "ckAuthorization",
            Selected = "true"
        };
         Checkbox ckAgreement = new Checkbox
        {
            TabLabel = "ckAgreement",
            Selected = "true"
        };

        RadioGroup radioGroup = new RadioGroup
        {
            GroupName = "radio1",
            // You only need to provide the readio entry for the entry you're selecting
            Radios = new List<Radio> { new Radio { Value = "white", Selected = "true" } }
        };

        Text includedOnTemplate = new Text
        {
            TabLabel = "text",
            Value = "Jabberywocky!"
        };

        // We can also add a new tab (field) to the ones already in the template
        Text addedField = new Text
        {
            DocumentId = "1",
            PageNumber = "1",
            XPosition = "280",
            YPosition = "172",
            Font = "helvetica",
            FontSize = "size14",
            TabLabel = "added text field",
            Height = "23",
            Width = "84",
            Required = "false",
            Bold = "true",
            Value = signerName,
            Locked = "false",
            TabId = "name"
        };

        // Add the tabs model (including the SignHere tab) to the signer.
        // The Tabs object wants arrays of the different field/tab types
        // Tabs are set per recipient/signer
        Tabs tabs = new Tabs
        {
            CheckboxTabs = new List<Checkbox> { ckAuthorization, ckAgreement },
            RadioGroupTabs = new List<RadioGroup> { radioGroup },
            TextTabs = new List<Text> { includedOnTemplate, addedField },
            ListTabs = new List<List> { colorPicker }
        };
点赞
评论