Docusign API signHere选项卡 - 不将表单字段转换为选项卡

时间:2017-06-29 13:59:15

标签: docusignapi

我正在尝试转换名称为signature_1且预填充值为signature_1的表单字段。

我一直关注此指南: https://www.docusign.com/developer-center/explore/features/stick-etabs

以下是我已就此问题撰写的问题:https://github.com/karmaradio/karma/issues/440

Docusign正在合同上创建signHere标签,但始终位于左上角,因此它无法识别signature_1表单字段。

我发送给docusign的对象:

{
  emailBlurb: "Please sign the document using link provided.",
  emailSubject: "Karma document sign",
  documents: [
    {
      documentBase64: "encoded",
      documentId: 1,
      name: "jackum-mur-PAYE-1.pdf",
      transformPdfFields: "true"
     }
  ],
  recipients: {
    signers: [
      {
        email: "jmurphy+c@gmail.com",
        name: "jackum mur",
        recipientId: 1,
        routingOrder: 1,
        tabs: {
          signHereTabs: [
            {
              documentId: "1",
              pageNumber: "1",
              tabLabel: "signature_1"
            }
          ]
        }
      },
      {
        email: "jmurphy+first@gmail.com", 
        name: "first signee",
        recipientId: 2,
        routingOrder: 2,
        tabs: {
          signHereTabs: [
            {
              documentId: "1", 
              pageNumber: "1",
              tabLabel: "signature_2"
            }
          ]
        }
      },
      {
        email: "jmurphy+second@gmail.com", 
        name: "second signee",
        recipientId: 3, 
        routingOrder: 3,
        tabs: {
          signHereTabs: [
            {
              documentId: "1", 
              pageNumber: "1",
              tabLabel: "signature_3"
            }
          ]
        }
      },
  status: "sent"
}

1 个答案:

答案 0 :(得分:2)

在检查了您共享的document之后,以下json应该适当地转换表单字段。查看选项卡标签的约定,不清楚哪些选项卡适用于特定收件人。所以我手动将每个tabLabel映射到收件人。从我的示例中,您可以根据正确的收件人移动选项卡。

如果您希望类似的标签类型自动填充相同的数据,请参阅here

以下是CreateEnvelope请求。

  

POST / v2 / accounts / {accountId} / envelope

{
  "emailSubject": "Document with Form fields",
  "status": "sent",
  "compositeTemplates": [
    {
      "document": {
        "documentBase64": "<Add the bas64 encoded document bytes here>",
        "documentId": "1",
        "name": "p60-form.pdf",
        "transformPdfFields": "true"
      },
      "inlineTemplates": [
        {
          "sequence": "1",
          "recipients": {
            "signers": [
              {
                "email": "jmurphy+c@gmail.com",
                "name": "jackum mur",
                "recipientId": "1",
                "routingOrder": "1",
                "tabs": {
                  "signHereTabs": [
                    {
                      "tabLabel": "signature_1"
                    },
                    {
                      "tabLabel": "signature_1DocuSignSignHere"
                    }
                  ],
                  "textTabs": [
                    {
                      "tabLabel": "signature_1 Student Loan deductions",
                      "value" : "<Pre-Fill Tab Value here>"
                    },
                    {
                      "tabLabel": "Student Loan deductions",
                      "value" : "<Pre-Fill Tab Value here>"
                    },
                    {
                      "tabLabel": "PAYE reference",
                      "value" : "<Pre-Fill Tab Value here>"
                    },
                    {
                      "tabLabel": "Your employer's full name and address (including postcode",
                      "value" : "<Pre-Fill Tab Value here>"
                    }
                  ]
                }
              },
              {
                "email": "jmurphy+first@gmail.com",
                "name": "first signee",
                "recipientId": "2",
                "routingOrder": "2",
                "tabs": {
                  "signHereTabs": [
                    {
                      "tabLabel": "signature_2"
                    },
                    {
                      "tabLabel": "signature_2 DocuSignSignHere"
                    }
                  ],
                  "textTabs": [
                    {
                      "tabLabel": "signature_2",
                      "value" : "<Pre-Fill Tab Value here>"
                    },
                    {
                      "tabLabel": "signature_2 Your employers full name and address including postcode",
                      "value" : "<Pre-Fill Tab Value here>"
                    }
                  ]
                }
              },
              {
                "email": "jmurphy+second@gmail.com",
                "name": "second signee",
                "recipientId": "3",
                "routingOrder": "3",
                "tabs": {
                  "signHereTabs": [
                    {
                      "tabLabel": "signature_3"
                    },
                    {
                      "tabLabel": "signature_3 DocuSignSignHere"
                    }
                  ],
                  "textTabs": [
                    {
                      "tabLabel": "signature_3 PAYE reference",
                      "value" : "<Pre-Fill Tab Value here>"
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  ]
}