Webhook called from Bot not working

Hi, I have a BOT trying to call a webhook and I keep getting the error shown below. I have some logging at the destination of that endpoint that does not register that any connection is even hitting it. Any thoughts?

<note that I’ve replaced some sensitive information with the text omitted and changed some of the parameter values>

Error:
"Webhook HTTP post request failed with exception The underlying connection was closed: The connection was closed unexpectedly. "

Properties:
 {
  "EventType": "Change",
  "InvokedBy": "Add",
  "AppTemplateVersion": "1.000505",
  "Process Name": "PROCESS SHE",
  "ServerRegion": "us-central1",
  "TableName": "Events",
  "OperationUpdateMode": "ADDS_ONLY",
  "EventMatch": "Workflow event successfully matched",
  "IgnoreSecurityFilters": false,
  "Condition": "",
  "MatchesCondition": "True",
  "Exception": "Webhook HTTP post request failed with exception The underlying connection was closed: The connection was closed unexpectedly. ",
  "Task Type": "Webhook",
  "Task Name": "RUN SHE WEBOOK",
  "Url": "https://omitted/_functions/sendEmail/sendHome",
  "Verb": "Post",
  "MimeType": "application/json",
  "Headers": "token:omitted",
  "Payload": "{\"userEmail\": \"myemail@mydomain.com\",\"type\": \"sendHome\"}",
  "Operation": "Change Bot",
  "Result": "Failure"
}

In this case your target host was requiring an additional header, User-Agent.

I debugged this case first by trying to hit your end point with Postman and ensuring that works.
Then I identified it using https://requestbin.com/ and hitting that url with both Postman and the AppSheet automation and identifying what are the differences in the request. Eventually it came down to a header in this case.

I hope that helps if you encounter such errors in the future.

2 Likes

Thank you so much Dan!