Timeout issues when sending the request to API

Hi all I am using webhooks / gravity to send form data to an API ,
method = POST
request format = JSON

Some entries arent making it to the database and seems to be happening fairly often . . . . too often for sure. and it has been mentioned it is possibly timeouts.

Where would I go to learn more about writing some PHP code to react to the response from the API. What would you suggest. Thank you in advance for any support,


1 Like

The first thing you can do without code is enable Gravity Forms logging:

You can check the Webhooks log for clues to what is happening. Each line in the log file will be timestamped, so you can see if timeouts are the issue,

Then, if you need to, you can proceed with some custom code.

Thanks Chris will run some debug and see if anything appears.

So I added logging / debugging and I am getting

WebApiEnquiry: Webhook was not successfully executed. cURL error 28: Operation timed out after 5001 milliseconds with 0 bytes received (0)

I am in contact with my host but they arent being very helpful.

What would you look at first in this case?

The host will have to help you with this. The connection is timing out after 5 seconds. The host has the best information available to tell you why that is and perform further tests to diagnose.

Ok so I got a response from everyone being vague about their own possible responsibility and firmly seating it back into my back yard.

Are there any pointers toward code I can use alongside Gravity for this sort of thing?
I know this is well outside of your average issue, but any help at all or even help finding someone who can code this sort of thing for me and cost it up would be great.

A mentioned possible fix.

Update the Website call to deal with any timeout or bad response issues.
(This has been my suggestion all along and generally is how systems work when sending requests across the Web via an HTTP POST)

Code would be added to the request to wait for a response, if bad it would react accordingly.
If no response is received, then the request is resent x number of times.
Should there be no response then the details of the request (Name, Course etc.) could be added to a log file. The log file could then be processed at a later date.

The following article includes some code you can use to increase the timeout limits: cURL error 28 in WordPress – Samuel Aguilera

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.