From 6c8c8ea508afcdf5367af95caa1619a6bb23ec4a Mon Sep 17 00:00:00 2001 From: DJP Date: Tue, 18 Nov 2025 09:09:01 -0500 Subject: [PATCH] Fix OMG API authorization header and private property access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed two issues: 1. Removed 'Bearer' prefix from Authorization header (OMG API expects just the key) 2. Fixed private property access error (hardcoded endpoint URL instead of accessing $omgService->config) OMG API now sends: Authorization: PeyJvcmciOiIy... Instead of: Authorization: Bearer PeyJvcmciOiIy... 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- OMGService.php | 2 +- process-csv.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OMGService.php b/OMGService.php index ded33e4..453cfdd 100644 --- a/OMGService.php +++ b/OMGService.php @@ -39,7 +39,7 @@ class OMGService { CURLOPT_TIMEOUT => $this->timeout, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', - 'Authorization: Bearer ' . $this->apiKey + 'Authorization: ' . $this->apiKey // Send API key directly (not "Bearer") ] ]); diff --git a/process-csv.php b/process-csv.php index 793e9df..1831b40 100644 --- a/process-csv.php +++ b/process-csv.php @@ -132,7 +132,7 @@ try { 'details' => $projectResult['details'] ?? '', 'action' => $projectResult['action'] ?? 'Check OMG API configuration', 'httpCode' => $projectResult['httpCode'] ?? 0, - 'endpoint' => $omgService->config['base_url'] . '/getProject?project_number=' . $campaignNumber, + 'endpoint' => 'https://api2.omg.oliver.solutions/loreal/v1/getProject?project_number=' . $campaignNumber, 'progress' => $progress ]); exit;