Hi,
I need to send API POST request to Espocrm from espo custom service code, which triggered by workflow.
CURL error response cURL error 28: Connection timed out;
When I'm run service code from my local machine, this curl normaly run without any error and create entity as I need.
Where is the problem? Can you help me please.
PS: I know how to create it with Entity manager, but it's not compatible with my another hook.
I need to send API POST request to Espocrm from espo custom service code, which triggered by workflow.
CURL error response cURL error 28: Connection timed out;
Code:
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'http://$myserverip/api/v1/SalesOrder', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>$NewSalesOrder, CURLOPT_HTTPHEADER => array( 'Authorization: Basic ***********', 'Content-Type: application/json' ), )); $response = curl_exec($curl); $code = curl_getinfo($curl, CURLINFO_HTTP_CODE); $error = curl_errno($curl); curl_close($curl);
Where is the problem? Can you help me please.
PS: I know how to create it with Entity manager, but it's not compatible with my another hook.