【问题标题】:Unable to set values for custom fields in template无法为模板中的自定义字段设置值
【发布时间】:2016-10-17 11:16:18
【问题描述】:

我的用例很简单。我想在我的模板中创建自定义字段,并通过根据收件人填写自定义字段来使用它来创建具有不同值的文档。我正在尝试在我的模板中设置自定义字段“test”,但它没有反映在创建的文档中。我无法理解我是否在这里犯了任何错误,因为我完全按照 api 示例的建议进行操作。

API - demo.docusign.net/restapi/v2/accounts/1938032/envelopes

{
  "accountId": "1938032",
  "emailSubject": "API Example - Populating Data in Templates",
  "templateId": "1bd2b688-b88f-445f-adf8-f5b462cf6dbb",
  "templateRoles": [{
    "email": "raghavneon@gmail.com",
    "name": "John Doe",
    "roleName": "test",
    "tabs": {
      "textTabs": [ {
        "tabLabel": "test",
        "value": "kasdfasdfadsfadsfads"
      }]
    }
  }],
  "status": "sent"
}

【问题讨论】:

标签: docusignapi


【解决方案1】:

如果您使用的是现有模板,则需要在模板本身中定义字段(选项卡)并命名为与您在 API 请求中提供的完全相同的 tabLabel。换句话说,查看您的请求,您需要在模板中的某处定义一个文本字段,该字段的标签为"test",以便您的 JSON 工作。

另一方面,如果您不使用模板,那么您可以像这样预填充:

{
    "status": "sent",
    "emailSubject": "Basic Tabs Example",
    "documents": [{
        "documentId": "1",
        "name": "contract.pdf",
        "documentBase64": "base64 document bytes...",
    }],
    "recipients": {
        "signers": [{
            "email": "john@email.com",
            "name": "John Doe",
            "recipientId": "1",
            "tabs": {
                "textTabs": [{
                    "tabLabel": "test",
                    "value": "12345",                    
                    "xPosition": "75",
                    "yPosition": "50",
                    "documentId": "1",
                    "pageNumber": "1"
                }]
            }
        }]
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-10-18
    • 1970-01-01
    • 1970-01-01
    • 2018-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多