You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Postman调用DocuSign REST接口无法接收事件通知至SFDC地址求助

排查DocuSign Event Notification回调失败的问题

针对你用Postman调用DocuSign API时,eventNotification无法回调到指定Salesforce Apex REST端点的问题,我从你的请求内容里发现了几个关键问题,同时也给你一些额外的排查建议:

1. Event Notification的位置错误

你把eventNotification嵌套在了templateRoles下的单个签署者对象里,但如果要接收整个信封生命周期的事件(比如sent、completed、voided这些),这个配置应该放在请求的顶层,和accountId、status同级。放在签署者层级的eventNotification只会触发该签署者相关的特定事件,而非整个信封的事件。

2. 布尔参数的类型错误

你的请求里所有布尔类型的参数(比如loggingEnabled、requireAcknowledgment、locked等)都用了字符串格式的"true"/"false",但DocuSign REST API要求这些参数是原生布尔值(不带引号的true/false)。字符串格式的布尔值会被API忽略,导致通知配置不生效。

3. 回调URL的占位符未替换

你填写的回调URL是[sfdc base url]/services/apexrest/Docusign,这里的[sfdc base url]必须替换成你实际的Salesforce实例URL,比如生产环境的https://your-domain.my.salesforce.com或者沙盒环境的https://your-domain--sandbox.my.salesforce.com,不能保留占位符。

4. 额外的排查要点

  • Salesforce端点的可访问性:确保你的Apex REST类设置了正确的权限(比如用@RestResource注解,并且配置了允许外部访问的权限集,或者通过Salesforce Sites暴露端点),同时要把DocuSign的回调IP范围加入Salesforce的信任IP列表。
  • DocuSign Connect日志:登录DocuSign Admin后台,找到Connect菜单,查看事件日志,这里会记录所有回调请求的状态、错误信息,能帮你快速定位问题(比如401权限错误、404路径错误等)。
  • 测试端点的连通性:可以用ngrok这类工具把本地的Salesforce开发者端点暴露到公网,测试DocuSign是否能成功发送回调,排除网络层面的问题。

修正后的请求示例

{
  "accountId": "8555983",
  "emailSubject": "This request is sent from a Template",
  "templateId": "4ce7f605-c2c8-40ab-b95b-7aaa0c765245",
  "eventNotification": {
    "url": "https://your-domain.my.salesforce.com/services/apexrest/Docusign",
    "loggingEnabled": true,
    "requireAcknowledgment": true,
    "useSoapInterface": false,
    "includeCertificateWithSoap": false,
    "signMessageWithX509Cert": false,
    "includeDocuments": true,
    "includeEnvelopeVoidReason": true,
    "includeTimeZone": true,
    "includeSenderAccountAsCustomField": true,
    "includeDocumentFields": true,
    "includeCertificateOfCompletion": true,
    "envelopeEvents": [
      { "envelopeEventStatusCode": "sent" },
      { "envelopeEventStatusCode": "delivered" },
      { "envelopeEventStatusCode": "completed" },
      { "envelopeEventStatusCode": "declined" },
      { "envelopeEventStatusCode": "voided" }
    ]
  },
  "templateRoles": [
    {
      "roleName": "Signer1",
      "name": "Prakhar",
      "email": "prakhar@example.com",
      "tabs": {
        "signHereTabs": [
          {
            "xPosition": "138",
            "yPosition": "654",
            "documentId": "1",
            "pageNumber": "1"
          }
        ],
        "textTabs": [
          {
            "tabLabel": "NameOfInstitution",
            "value": "Example",
            "locked": true,
            "xPosition": "245",
            "yPosition": "310",
            "documentId": "1",
            "pageNumber": "1"
          }
        ]
      }
    }
  ],
  "status": "sent"
}

内容的提问来源于stack exchange,提问作者Prakhar Nigam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 08:22:28