I try to receive signed file from Docusing using web hook listener, before it working file , but form 31-05-2022 Docusing cant call our web hook listener.
When i check log from Connect menu, i got this error on bottom
6/22/2022 | 3:52:07 pm
Error: Exception in EnvelopeIntegration.RunIntegration: ac08432f-18c4-471d-8720-caaf78fe4dfc :: No URI :: Error - Invalid URI: The URI is empty.;
This is the code i pass web hook listener url.
Dim eventNotification = New EventNotification()
eveventNotification.Url ="https://www.sample.com/webhook/default.aspx"
eventNotification.RequireAcknowledgment = "true"
eventNotification.IncludeDocuments = "true"
eventNotification.LoggingEnabled = "true"
May i know exact problem ? This final success receive from web listener is 5/30/2022, after that all are failure.
Thanks and Regards
Aravind
This error typically means you're using envelope-level EventNotifications, but you're not actually defining a valid url parameter when you're sending an envelope.
You'll want to check your Envelope Definition in your code, but you can also use API Request Logging to capture what your application is sending to DocuSign
Related
I like to configure logic app is there is any failure inside it and then it has to sent email alert there failure into logic app.
Please help in that. If you did the same please sent it with sample screen.
I have created a sample flow with parallel flows where both receives error. I have created a variable and appended the errors of each of the flow to the string variable. Finally, I have sent the resultant string to email. Below is the flow of my logic app.
RESULTS :
IN MY EMAIL :
I am trying to access the api TemplateViews : createEdit using python docusign_esign api as below
api_client = ApiClient(header_name="Authorization", header_value=f"Bearer {access_token}",
host="https://demo.docusign.net/restapi/")
TemplatesApi(api_client).create_edit_view(account_id=account_id, template_id=template_id)
while accessing the create_edit_view I am getting the error as
"errorCode":"INVALID_REQUEST_BODY","message":"The request body is missing or improperly formatted."
when checked in the API explorer, I am able to get the response URL correctly. I found only the accountId and templateId is mandatory for accessing the api, am I missing something else here?
https://developers.docusign.com/docs/esign-rest-api/sdk-tools/python/reference/docusign_esign/apis/templates_api.html#docusign_esign.apis.templates_api.TemplatesApi.create_edit_view
You need to provide a return_url, it's a URL that your embedded sender will be redirected back to when they finished editing/creating the template.
This is a POST and this URL is provided in the body as JSON, not in the URL as a parameter.
https://developers.docusign.com/docs/esign-rest-api/reference/templates/templateviews/createedit/
I am using Docusign's REST API to create and send envelopes. I've included eventNotifications with requireAcknowledgment as true to get requests from Docusign whenever there's status change. I used ngrok while development and testing and everything worked as expected.
I've moved the project online and have edited the eventNotification's url to live url with https and that's when all the callbacks are getting logged in failed section in Docusign's admin panel.
The error message shown in admin panel is -
'https://xxx.xxxxxxx.com/webhook.php :: Error - The remote server
returned an error: (400) Bad Request.'
I've downloaded the failed request's xml body and tried sending a request through postman and it worked as expected. Iv'e tried everything to debug this error and have not found error at my end.
Edit:
The code that I've tried with is the same code from DocuSign's webhook sample page -
$data = file_get_contents('php://input');
$xml = simplexml_load_string ($data, "SimpleXMLElement", LIBXML_PARSEHUGE);
$envelope_id = (string)$xml->EnvelopeStatus->EnvelopeID;
$time_generated = (string)$xml->EnvelopeStatus->TimeGenerated;
$files_dir = getcwd() . '/' . $this->xml_file_dir;
if(! is_dir($files_dir)) {mkdir ($files_dir, 0755);}
$envelope_dir = $files_dir . "E" . $envelope_id;
if(! is_dir($envelope_dir)) {mkdir ($envelope_dir, 0755);}
$filename = $envelope_dir . "/T" .
str_replace (':' , '_' , $time_generated) . ".xml"; // substitute _ for : for windows-land
$ok = file_put_contents ($filename, $data);
if ($ok === false) {
error_log ("!!!!!! PROBLEM DocuSign Webhook: Couldn't store $filename !");
exit (1);
}
// log the event
error_log ("DocuSign Webhook: created $filename");
if ((string)$xml->EnvelopeStatus->Status === "Completed") {
// Loop through the DocumentPDFs element, storing each document.
foreach ($xml->DocumentPDFs->DocumentPDF as $pdf) {
$filename = $this->doc_prefix . (string)$pdf->DocumentID . '.pdf';
$full_filename = $envelope_dir . "/" . $filename;
file_put_contents($full_filename, base64_decode ( (string)$pdf->PDFBytes ));
}
}
I've also tried with simple code that just sets header to 200
http_response_code(200);
Sorry you're having so much trouble with the webhook feature. Hopefully this answer will be of assistance.
1. Try a test PHP program to check connectivity, etc:
<?php
header('Content-Type: text/html');
echo "OK!";
$h = fopen('/tmp/listener_access.log', 'a');
if ($h) {
$now = DateTime::createFromFormat('U.u', microtime(true), new DateTimeZone('UTC'));
fwrite ($h, $now->format ("Y-m-d_l.h.i.s.v "));
fwrite($h, $_SERVER["REMOTE_ADDR"] . " " . $msg . "\n");
fclose($h);
} else {
error_log ("### Could not open log file!");
}
Store it as ok.php in your web server directory. Then try (from a browser on a different network) to reach https://yourserver.company.com/ok.php You should see "ok" in the browser window.
Then use the same url in your eventNotification section of your Envelopes::create call to see if it all works. You should see a success in the Connect log, etc.
2. Stepwise debugging of your PHP listener
There are a number of issues to rule-out (as diagnosticians say) with your php listener app.
Basic connectivity with the listener. Since DocuSign is receiving a 400 error from your app, connectivity is ok.
Platform errors with your app. This is a problem with your PHP software stack setup that is causing the stack (not your PHP app, per se) to reject the request.
The usual indicator for this is your web server's error log. Have you looked at it? What is on the logging line where you see the 400 response from your server to DocuSign? If you don't see the 400 response to DocuSign then something is wrong with your web server's setup.
A common platform error with PHP and other stacks when default settings are used is maximum_post_size_exceeded. This is happens if you have requested that DocuSign include your envelope's documents in the notification message.
A good test is to temporarily change your envelope create code to not include documents in the notification messages.
Fixes: a good fix is to not include the envelope documents in the notification message. Instead, after the message is received, make separate API calls to retrieve the documents.
The other fix is to increase the maximum post body size. You may need to increase it both in the PHP settings and in the underlying web server's settings too. (By the way, which web server are you using?)
You are processing the incoming notification in the response thread of your server/php app. This really isn't the best technique (I will be updating the DocuSign example page in the future with this information.)
The best technique is to use the following pattern:
1. Receive the incoming notification message from DocuSign
2. Put the message onto a reliable FIFO queue
3. Respond to DocuSign with a 200 response.
Then, in a separate thread of execution, a
different software application "works off" the
entries in the queue.
Your web server, for example, may be timing out your PHP program. This probably isn't happening in your case, but others may experience this.
I think I would, next, add more debugging statements to your PHP program to try and understand what is happening to it. You can either do this with error-log
or copy the technique from my example (above) and write to a file in /tmp. (Assuming a Linux server.)
The other option is to increase the debugging level of the php stack itself, or of your web server, or both.
3. Last thoughts
400 in the DocuSign logs usually indicates that DocuSign reached your server and it returned a 400 status code. This can be confirmed by examining your server log (regular or error), there should be a matching entry.
If there isn't an entry in your server log, but the "ok.php" program from above does work, then it would be time to comment out big chunks of code from your PHP program, and then do another test from DocuSign. Eventually, using a binary-search technique (See step 8 in the article), you find the code that is causing the problem.
Commenting out code as part of a binary-search to find the bug is a very common, and powerful debugging technique.
HTH, Larry
I'm successfully able to create envelop and send a document for a sign, Here is output of my code
Here is my hook registered in DocuSign
And this is the code of my webhook in which I'm just dumping request into file.
And when I complets the document Docusign send push notification to this url, and in that notification it sends nothing, I've tested it 4 times....
What I'm doing wrong?
print_r() doesn't seem to handle $_REQUEST or $_POST in a way that's particularly useful. Try this instead:
$request = file_get_contents('php://input');
$req_dump = print_r( $request, true );
then file_put_contents as you have it
This is for those who have tried using Mandrill .NET in github.
I need to be able to process inbound mails, and based on Mandrill documentation, I have to create a webhook with a corresponding public url. In terms of implementing the action method, I followed the method signature as described in the documentation of WebHookEvent.cs. At that point everything was working as expected: if I send mail to the mandrill email which I registered to the webhook event, the action method is invoked from Mandrill. For discussions's sake let's assume that the method name is ProcessInboundMail.
Moving forward, my app needs to support multitenancy. So instead of a straightforward processing in the method ProcessInboundMail, I have to somehow Redirect to a url that includes the appropriate subdomain (e.g. company1.myapp.com/mycontroller/ProcessInboundMail). From then on I started to encounter a peculiar issue.
If I send mail to the mandrill email, the action method is no longer properly executed. To verify if the webhook is working, I went to the mandrill admin page > Inbound > Domains (InboundDomains.png), clicked Routes button, then clicked the button "send test" (MailboxRoutes.png), but all I get is this error message:
Webhook failed with error: POST to http://myapp.com/mycontroller/ProcessInboundMail failed with 411: Length Required
Length Required
HTTP Error 411. The request must be chunked or have a content length.
Here is how my ProcessInboundMail looks like:
[AllowAnonymous]
[ValidateInput(false)] // May be required if accepting inbound webhooks
[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post | HttpVerbs.Head)]
public ActionResult ProcessInboundMail(string id, FormCollection val)
{
var events = Mandrill.JSON.Parse<List<Mandrill.WebHookEvent>>(val.Get("mandrill_events"));
foreach (var e in events)
{
//logic here...
var redirectResult = Redirect(toSomeUrl);
redirectResult.ExecuteResult(this.ControllerContext);
}
return Json(1, JsonRequestBehavior.AllowGet);
}
My question is, how come when I was not using Redirect, clicking "send test" was successful, but now that I am using Redirect, I'm getting this HTTP error 411 when clicking "send test"? What am I doing wrong here?