Fix Google Sheets API valueInputOption parameter handling

- Move valueInputOption from JSON body to query parameter as required by Google Sheets API
- Update make_api_request method to properly extract and append valueInputOption as URL parameter
- Resolves 'Invalid JSON payload received. Unknown name valueInputOption' error
- Google Sheets API calls now use correct parameter structure

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
bengizmo 2025-06-14 20:42:26 -03:00
parent 7c0cbeac45
commit 5896765533

View file

@ -207,6 +207,12 @@ class HVAC_Google_Sheets_Auth {
$base_url = ($api_type === 'drive') ? $this->drive_api_url : $this->sheets_api_url;
$url = $base_url . $endpoint;
// Handle valueInputOption as query parameter for Sheets API
if ($data && isset($data['valueInputOption'])) {
$url .= '?valueInputOption=' . urlencode($data['valueInputOption']);
unset($data['valueInputOption']); // Remove from body data
}
$args = array(
'method' => $method,
'headers' => array(