Skip to content

Commit a92fbb7

Browse files
committed
fix: zohoSheet fetching header issue fixed
1 parent 1008f1e commit a92fbb7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

includes/Actions/ZohoSheet/ZohoSheetController.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace BitCode\FI\Actions\ZohoSheet;
44

5-
use WP_Error;
6-
use BitCode\FI\Flow\FlowController;
75
use BitCode\FI\Core\Util\HttpHelper;
6+
use BitCode\FI\Flow\FlowController;
7+
use WP_Error;
88

99
class ZohoSheetController
1010
{
@@ -118,7 +118,14 @@ public static function getWorksheetHeader($requestParams)
118118
'Authorization' => 'Zoho-oauthtoken ' . $token->access_token,
119119
];
120120

121-
$apiEndpoint = "https://sheet.zoho.{$requestParams->dataCenter}/api/v2/{$requestParams->workbook}?method=worksheet.records.fetch&worksheet_name={$requestParams->worksheet}&count=1&header_row={$requestParams->headerRow}";
121+
$queryParams = [
122+
'method' => 'worksheet.records.fetch',
123+
'worksheet_name' => $requestParams->worksheet,
124+
'count' => 1,
125+
'header_row' => $requestParams->headerRow
126+
];
127+
$apiEndpoint = "https://sheet.zoho.{$requestParams->dataCenter}/api/v2/{$requestParams->workbook}?" . http_build_query($queryParams);
128+
122129
$apiResponse = HttpHelper::get($apiEndpoint, null, $headers);
123130

124131
if (isset($apiResponse->records)) {

0 commit comments

Comments
 (0)