0

我在 EnvelopeCreate 方法中创建信封时添加了事件通知

apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + AccessToken);
        EnvelopesApi envelopesApi = new EnvelopesApi(apiClient);
        EnvelopeSummary results = envelopesApi.CreateEnvelope(AccountId, env);           
        EventNotificationForEnvelope();

和 EventNotificationForEnvelope 方法是

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
        EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
        var eventNotification = new EventNotification();
        // Set up the endpoint URL to call (it must be using HTTPS and at least TLS1.1 or higher)
        eventNotification.Url = "https:\\testapi.example.com/api/DocuSignEventNotification";
        // DocuSign will retry on failure if this is set
        eventNotification.RequireAcknowledgment = "true";
        // This would send the documents together with the event to the endpoint
        eventNotification.IncludeDocuments = "true";
        // Allows you to see this in the DocuSign Admin Connect logs section
        eventNotification.LoggingEnabled = "true";
        var envelopeEvents = new List<EnvelopeEvent>();
        // In this case we only add a single envelope event, when the envelope is completed. You can also add events for recipients
        envelopeEvents.Add(new EnvelopeEvent { EnvelopeEventStatusCode = "completed",
            IncludeDocuments = "true" });
        eventNotification.EnvelopeEvents = envelopeEvents;
        envelopeDefinition.EventNotification = eventNotification;

在我的 api 控制器中

public class DocuSignEventNotificationController : ApiController
{
    [HttpPost]
    [HttpGet]
    public HttpResponseMessage DocuSignDocumentStatus(HttpResponseMessage responseMessage)
    {
        dynamic response = responseMessage.Content.ReadAsStringAsync();
        //here I will read values from response and use in my application
        return Request.CreateResponse(HttpStatusCode.OK, "Testing");
    }
}

我没有收到有关信封创建的任何响应,并且当状态正在更新该信封时

4

1 回答 1

0

有几件事。第一的,

https:\testapi.example.com/api/DocuSignEventNotification

我想不是你有你的服务器的地方。确保您使用 https 并且您的服务器已正确配置为接受 TLS(1.2 及更高版本)。使用云服务或其他第三方而不是自己构建要容易得多。如果您使用自己的,您可能需要确保防火墙等允许来自互联网的请求。

其次,您可以在 DocuSign Web 应用程序的“连接”部分设置区域中找到一个日志,该日志可以显示所有访问服务器的尝试。这可以帮助您确定对 DocuSign 的请求是否正确,以及 DocuSign 是否尝试调用您的服务器,如果是,则可能返回了什么错误。

只需点击“日志”: 在此处输入图像描述

于 2021-10-16T18:08:11.003 回答