I'm using an API package send data to endboint using cURL
function create_customer_event() {
$data = [
'email' => $shopify_json['email'] ?? '',
'firstname' => $shopify_json['first_name'] ?? '',
'lastname' => $shopify_json['last_name'] ?? '',
];
$api = new MauticApi();
$contactApi = $api->newApi('contacts', $auth, $apiUrl);
$contactApi->create($data);
}
Then i have a webhook that send POST request to the same page and when this page that has this function receive this post request it run this function. The problem im facing is that the app that send that POST requests to my script if found that the response took more than few seconds it re-send the request again.
So im wondering if there is a way to receive that POST request to my script and respond with 200 then run my function in the background independantly (Since my function can take more than 2 seconds to excute).
I understand that it can be done by coding my curl function but it will be hard to implement since i will have to handle the oAuth2 also which was dont by the package.