Docusign API:texttab的JSON提交成功,但值不会出现在documen中

2024-10-01 15:49:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我能够成功地将包含textTabsfullName选项卡的JSON提交到Docusign API(POST at[baseURL]/envelopes),调用模板,并且我确实收到了要签名的文档:

{ "accountId": "xxx",
  "status": "sent",
  "emailSubject": "Please sign this document",
  "emailBlurb": "Here's a document for you to sign",
  "templateId": "xxxx",
  "templateRoles": [
        {
        "email": "test@email.com",
        "name": "Test Recipient",
        "tabs": 
              { "textTabs":
                [{"tabLabel": "\\*Doc_Name",
                  "name": "Doc_Name",
                  "value": "Doc Value Goes Here",
                  "DocumentId": "1",
                  "PageNumber": "1"},

                  {"tabLabel": "\\*Doc_Phone",
                  "name": "Doc_Phone",
                  "value": "8675309",
                  "DocumentId": "1",
                  "PageNumber": "1"},


                  {"tabLabel": "\\*Doc_Fax",
                  "name": "Doc_Fax",
                  "value": "5551212",
                  "DocumentId": "1",
                  "PageNumber": "1"} ],

                "fullNametabs":
                  [ {"tabLabel": "FULLName",
                  "name": "FullName",
                  "value": "The Full Name Goes Here",
                  "DocumentId": "1",
                  "PageNumber": "1"}]

                          } 
                  ,

        "roleName": "parent_signer" }  ] }

我的模板在该模板中的文档中具有具有相同数据标签的自定义字段:

https://imgur.com/a/9c0dJ

https://imgur.com/Qj9NhSj

在模板的文档中,我将这些字段放置在文档的正文中:

https://imgur.com/a/HCTRe

但是,当文档到达进行签名时,这些字段并不像我期望的那样预先填充。文档显示,但没有预先填充的字段:

https://imgur.com/kzHxxds

信封选项卡、模板选项卡和自定义字段之间有区别吗?


Tags: name文档httpscom模板docherevalue
1条回答
网友
1楼 · 发布于 2024-10-01 15:49:15

收件人没有看到信封中的选项卡的原因是roleName区分大小写,并且您在JSON请求中指定的roleName的大小写(parent_signer)与在模板中指定的收件人角色名称的大小写(Parent_signer)不匹配。你知道吗

此外,您还可以对JSON请求进行其他一些改进:

  • 您不需要指定accountId,它已经在请求URI中指定了,因此将它包含在请求主体中是多余的,没有必要的。

  • 您不需要为每个选项卡指定namedocumentIdpageNumber,因为模板已经包含选项卡,DocuSign已经知道它们应该出现在文档中的何处。

  • 您不需要在请求正文中指定全名选项卡DocuSign将自动用收件人的名称填充全名选项卡(实际上您不能为这种类型的选项卡指定值,因为DocuSign总是使用签名者的名称自动设置选项卡值)。

这是您的JSON请求,应用了以下更改:

{ 
  "status": "sent",
  "emailSubject": "Please sign this document",
  "emailBlurb": "Here's a document for you to sign",
  "templateId": "xxxx",
  "templateRoles": [
    {
      "email": "test@email.com",
      "name": "Test Recipient",
      "tabs": 
        { 
          "textTabs": [
              {
                "tabLabel": "\\*Doc_Name",
                "value": "Doc Value Goes Here"
              },
              {
                "tabLabel": "\\*Doc_Phone",
                "value": "8675309"
              },
              {
                "tabLabel": "\\*Doc_Fax",
                "value": "5551212"
              }
          ]
        },
        "roleName": "Parent_signer" 
    }  
  ] 
}

相关问题 更多 >

    热门问题