1

I have added event notification at the time of envelope creation in EnvelopeCreate Method as

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

and EventNotificationForEnvelope method is as

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;

and in my api's controller as

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");
    }
}

I am not getting any response on envelope create and when status is updating of that envelope

  • You use "https:\\testapi.example.com/api/DocuSignEventNotification" or is this some other URL that you use? Also, you can check the Connect log to see if there are any errors – Inbar Gazit Oct 13 '21 at 18:24

1 Answers1

0

A couple of things. First,

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

Is not where you have your server I presume. Make sure that you use https and that your server is configured correctly to accepts TLS (1.2 and above). Using a cloud service or some other third-party instead of building your own is much easier. If you do use your own, you may need to ensure firewall etc. allow for requests coming from the internet.

Second, There's a log that you can find in the Connect section settings area in the DocuSign web app that can show you all attempts to reach servers. That can help you figure out if the request was made correctly to DocuSign and if DocuSign attempted to call your server and if so - what error may have been returned.

Just click "Logs": enter image description here

Inbar Gazit
  • 12,566
  • 1
  • 16
  • 23
  • So the envelope that you sent with the event notification above, was sent, you saw it going out, no errors from API? and nothing in logs? – Inbar Gazit Oct 18 '21 at 15:33
  • Yes, after envelope create as EnvelopesApi envelopesApi = new EnvelopesApi(apiClient); EnvelopeSummary results = envelopesApi.CreateEnvelope(AccountId, env); EventNotificationForEnvelope(); and all are executed without error, my envelope also created with file and signers, all signers completed all steps of signing n it was completed. Still not log no error – Shyam Vashista Oct 19 '21 at 04:23
  • Yes I have solved. Thanks – Shyam Vashista Oct 21 '21 at 06:44
  • What was the issue? – Inbar Gazit Oct 21 '21 at 15:37