将webhook与Docusign一起使用 - 我是否可以获得自定义字段?

时间:2017-02-09 20:33:29

标签: docusignapi

我用一个签名者,一个模板,3个不同的文档创建了一个信封。我在信封上添加了一个自定义字段。我发送信封并在我指定的网址上得到回复。我看看响应,我没有在那里看到自定义信封字段。它应该与响应一起发送吗?这是我发送的内容:

 {
  "customFields": {
    "textCustomFields": [
      {
        "name": "file id",
        "value": "1823456"
      }
    ]
  },
  "eventNotification": {
    "url": "http://requestb.in/16avl8c1",
    "loggingEnabled": "true",
    "requireAcknowledgment": "true",
    "envelopeEvents": [
      {
        "envelopeEventStatusCode": "Delivered"
      },
      {
        "envelopeEventStatusCode": "Completed"
      },
      {
        "envelopeEventStatusCode": "Declined"
      },
      {
        "envelopeEventStatusCode": "Voided"
      },
      {
        "envelopeEventStatusCode": "Sent"
      }
    ],
    "useSoapInterface": "false",
    "includeCertificateWithSoap": "false",
    "signMessageWithX509Cert": "false",
    "includeDocuments": "false",
    "includeEnvelopeVoidReason": "false",
    "includeTimeZone": "true",
    "includeSenderAccountAsCustomField": "true",
    "includeDocumentFields": "true",
    "includeCertificateOfCompletion": "false"
  },
  "compositeTemplates": [
    {
      "compositeTemplateId": "1",
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "a0d319ef-ad34-4a2e-a375-069ce2df630c"
        }
      ],
      "inlineTemplates": [
        {
          "sequence": "2",
          "recipients": {
            "signers": [
              {
                "name": "Kathy Gilbert",
                "email": "KathyGilbert11@xxx.com",
                "recipientId": "1",
                "routingOrder": "1",
                "roleName": "##Buyer1"
              }
            ]
          }
        }
      ],
      "document": {
        "documentId": "1",
        "name": "Here is document one of the test.docx",
        "fileExtension": "docx",
        "documentBase64": [bytearray]
      }
    },
    {
      "compositeTemplateId": "2",
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "a0d319ef-ad34-4a2e-a375-069ce2df630c"
        }
      ],
      "inlineTemplates": [
        {
          "sequence": "2",
          "recipients": {
            "signers": [
              {
                "name": "Kathy Gilbert",
                "email": "KathyGilbert11@xxx.com",
                "recipientId": "1",
                "routingOrder": "1",
                "roleName": "##Buyer1"
              }
            ]
          }
        }
      ],
      "document": {
        "documentId": "2",
        "name": "Here is document two of the test",
        "fileExtension": "docx",
        "documentBase64": [bytearray]
      }
    },
    {
      "compositeTemplateId": "3",
      "serverTemplates": 
        {
          "sequence": "1",
          "templateId": "a0d319ef-ad34-4a2e-a375-069ce2df630c"
        }
      ],
      "inlineTemplates": [
        {
          "sequence": "2",
          "recipients": {
            "signers": [
              {
                "name": "Kathy Gilbert",
                "email": "KathyGilbert11@xxx.com",
                "recipientId": "1",
                "routingOrder": "1",
                "roleName": "##Buyer1"
              }
            ]
          }
        }
      ],
      "document": {
        "documentId": "3",
        "name": "Here is document three of the test",
        "fileExtension": "docx",
        "documentBase64": [bytearray]
      }
    }
  ],
  "status": "sent",
  "emailSubject": "Please sign the following document at 3:20 PM"
}

1 个答案:

答案 0 :(得分:4)

连接webhook响应将包含信封自定义字段,如果它们已成功添加到信封中。

对于CompositeTemplates,将忽略在根级别指定的CustomField。您应该在内联模板中指定自定义字段。

疑难解答提示:您可以执行其他检查以查看是否使用listCustomFields api创建自定义字段。

这是一个例子。

"compositeTemplates": [
    {
        "compositeTemplateId": "1",
        "serverTemplates": [
            {
                "sequence": "1",
                "templateId": "a0d319ef-ad34-4a2e-a375-069ce2df630c"
            }
        ],
        "inlineTemplates": [
            {
                "sequence": "2",
                "customFields": {
                   "textCustomFields": [
                   {
                    "name": "file id",
                    "value": "1823456"
                   }
                  ]
                },
                "recipients": {
                    "signers": [
                        {
                            "name": "Kathy Gilbert",
                            "email": "KathyGilbert11@xxx.com",
                            "recipientId": "1",
                            "routingOrder": "1",
                            "roleName": "##Buyer1"
                        }
                    ]
                }
            }
        ]
    }