Using webhook with Docusign - will I be able to ge

2019-08-06 06:32发布

问题:

I created an envelope with one signer, 1 template, 3 different docs. I added a custom field to the envelope. I send off the envelope and get the response back on the url I specified. I look at the response and I don't see the custom envelope field in there. Should it be sent along with the response? Here is what I sent:

 {
  "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:

Connect webhook response will contain the Envelope Custom Fields if they were added to the envelope successfully.

For CompositeTemplates the CustomFields specified at the root level are ignored. You should specify the Custom Fields within the inline template.

Troubleshooting Tip:You can do an additional Check to see if the Custom Fields are created by using listCustomFields api.

Here is an example.

"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"
                        }
                    ]
                }
            }
        ]
    }


标签: docusignapi