diff --git a/OMGService.php b/OMGService.php index 453cfdd..503f613 100644 --- a/OMGService.php +++ b/OMGService.php @@ -34,13 +34,20 @@ class OMGService { error_log('OMG API: Requesting project ' . $projectNumber); $ch = curl_init($url); + + // Try different header formats - log what we're sending + $headers = [ + 'Content-Type: application/json', + 'X-API-Key: ' . $this->apiKey, + 'Authorization: ' . $this->apiKey + ]; + + error_log('OMG API: Sending headers: ' . json_encode($headers)); + curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => $this->timeout, - CURLOPT_HTTPHEADER => [ - 'Content-Type: application/json', - 'Authorization: ' . $this->apiKey // Send API key directly (not "Bearer") - ] + CURLOPT_HTTPHEADER => $headers ]); $response = curl_exec($ch);