$subject, 'customField2' => $customer_name, 'customField3' => $customer_address, 'customField4' => $customer_phone_number, 'customField5' => $customer_email, 'customField6' => $customer_number, 'customField7' => $customer_service_pin, 'description' => [ 'raw' => $description ] ]; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://project.xinon.at/api/v3/projects/10/work_packages', 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 => json_encode($data), CURLOPT_HTTPHEADER => array('Content-Type: application/json'), CURLOPT_USERPWD => 'apikey:'.$apiKey )); curl_setopt($curl, CURLOPT_USERPWD, 'apikey:'.$apiKey); $response = curl_exec($curl); curl_close($curl); return $response; } } ?>