【问题标题】:DocuSign envelope with editable tabs that have a pre-set value带有预设值的可编辑标签的 DocuSign 信封
【发布时间】:2021-08-04 21:23:12
【问题描述】:

我正在与 DocuSign 集成,并且需要能够在我创建的信封中的文档上包含 可编辑 预填充选项卡。我正在使用 Python 中的 requests 库访问他们的 API。

DocuSign 的特殊pre-filled 选项卡明确锁定该值,并且不允许对收件人/签名者进行编辑。我已经能够添加和填充常规 text 选项卡的值,不幸的是这些选项卡也被锁定以进行编辑。

进一步的背景:
我正在编写一个 API 端点,该端点将检索收件人信息,使用预填充选项卡的模板创建信封,然后返回前端 URL 以显示应用内签名。

【问题讨论】:

    标签: python docusignapi


    【解决方案1】:

    以下是用于创建带有预填充和可编辑选项卡的信封实例的代码:

    def make_new_envelope(template_id, account_id):
        data = json.dumps({
          "templateId": "<template_id>",
          "status": "sent",
          "templateRoles": [
            {
              "clientUserId": "<any string of your choosing>", # required but determined by you
              "email": "test@test.com",
              "name": "Maggie Nelson",
              "roleName": "signer",
              "tabs": {
                "textTabs": [
                    {
                        "tabLabel": "Text a494f42f-654e-49e1-9add-dd87bdc0dd04",
                        "fontSize": "size9",
                        "fontColor": "black",
                        "font": "lucidaconsole",
                        "required": "true",
                        "locked": "false",
                        "value": "home phone number",
                        "maxLength": 4000,
                        "width": 84,
                        "height": 27,
                        "documentId": "1",
                        "recipientId": "1",
                        "pageNumber": 1,
                        "tabId": "d94dd078-c808-4ced-a1b1-d3d1a577bca0",
                        "tabType": "text",
                        "xPosition": 232,
                        "yPosition": 343,
                    }
                  ]
              }
            }
          ]
        })
    
        envelope_url = "/v2.1/accounts/{account_id}/envelopes".format(account_id=account_id)
        x = requests.post(url=BASE_URL + envelope_url, headers=headers, data=data)
        return x.json()['envelopeId']
    

    除了选项"locked": "false" 之外,我不肯定所有这些都必须包含在描述选项卡的 json 对象中。

    tabLabeltabId 值与模板的已定义选项卡无关。似乎可以将它们设置为您想要的任何值。

    关于更新已经创建的信封上的标签...我还没有成功。我会注意到这里详述的错误似乎仍然存在Calling EnvelopesApi#update_document_tabs returns an error

    【讨论】:

      猜你喜欢
      • 2019-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多