"https://heronendpointsprd.azurewebsites.net/CreateOpportunity?user=gkiouzepaspavlos%40hotmail.com&commodity=2&application_type=0&action=create", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "OPTIONS", CURLOPT_POSTFIELDS => "", ]); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { } else { } return json_decode($response, true); } function clinet_get() { $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://heronendpointsprd.azurewebsites.net/CreateOpportunity?user=gkiouzepaspavlos%40hotmail.com&commodity=2&application_type=0&action=create", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "OPTIONS", CURLOPT_POSTFIELDS => "", ]); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { } else { } return json_decode($response, true); } $result = client_option(); $retsult = clinet_get(); // URL for the API endpoint $url = 'https://api-eu1.dealhub.io/api/v1/create/quote'; // Request data in JSON format $data = json_encode(array("opportunity_id" => $result['opportunity_id'])); // Headers for the request $headers = array( 'Accept: */*', 'Accept-Encoding: gzip, deflate, br', 'Accept-Language: el,en;q=0.9,el-GR;q=0.8', 'Authorization: Bearer ' . $result['access_token'], 'Content-Type: application/json', 'Content-Length: ' . strlen($data), 'Cookie: _cq_duid=1.1700351954.U7Sm5qAYskQjlU3L; _ym_uid=1700351956195765124; _ym_d=1700351956; _hjSessionUser_1960515=eyJpZCI6Ijc5OTk1OTUxLWE0NWEtNWNhOS1iZTY1LWFhMTg4OTZmYWI1NiIsImNyZWF0ZWQiOjE3MDAzNTE5NTc2NzIsImV4aXN0aW5nIjp0cnVlfQ==; _ym_isad=1; _cq_suid=1.1700484531.jfyGsTTspOGMffBb; DEALHUB_PLAY_SESSION=eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImNzcmZUb2tlbiI6IjRkYjkzNTRhMzUxYWMyODgxN2I3ZmYxYWMyNmVkOGY5MjM0YzFlZWEtMTcwMDQ3ODUyNjkzNS1mZmNkNTAxZGQ3ZGZmNDk3ODA2MTM1ZDQifSwibmJmIjoxNzAwNDkyMDA4LCJpYXQiOjE3MDA0OTIwMDh9.Z9BWLldP7pQRZb3ro40DKixRwGKLfxTnc1zzE3IjKmI; authToken=f0381841-bb7a-41bb-9e1e-5c1dc4f21066', 'Host: api-eu1.dealhub.io', 'Origin: https://heron2.sharepoint.com', 'Referer: https://heron2.sharepoint.com/', 'Sec-Fetch-Dest: empty', 'Sec-Fetch-Mode: cors', 'Sec-Fetch-Site: cross-site', 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36', 'sec-ch-ua: "Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"', 'sec-ch-ua-mobile: ?0', 'sec-ch-ua-platform: "Windows"' ); // Initialize cURL session $ch = curl_init($url); // Set cURL options curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); // Execute cURL session and get the response // Set headers curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // Set other cURL options as needed curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); // Get the HTTP response code $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); if (curl_errno($ch)) { echo 'Curl error: ' . curl_error($ch); } curl_close($ch); // Check for cURL errors if (curl_errno($ch)) { echo 'Curl error: ' . curl_error($ch); } $r = json_decode($response, true); echo $r['url']; // Decompress the gzipped text // Close cURL session curl_close($ch); // Display the response