I have the following situation, I am using the API from Google Drive to create a table with Google Service Sheets . The document creates it without problem, when I start uploading the records and I reach the 100 register, it sends me a message that tells me that I have exceeded the registration fee to upload. My question is, is there any way to upload more than 100 records through API from Google Drive ?
Error:
Fatal error: Uncaught Google_Service_Exception: {"error": {"code": 429, "message": "Quota exceeded for quota group 'WriteGroup' and limit 'USER-100s' of service 'sheets.googleapis.com' for consumer 'project_number: 569124525622'. "," errors ": [{" message ":" Quota exceeded for quota group 'WriteGroup' and limit 'USER-100s' of service 'sheets.googleapis.com' for consumer 'project_number: 569124525622'. ", "domain": "global", "reason": "rateLimitExceeded"}], "status": "RESOURCE_EXHAUSTED"}} in /opt/lampp/htdocs/distrivucion/lib/gdriver/vendor/google/apiclient/src/Google/Http/REST.php on line 118
Function to upload files
$i = 5;
while ($row = $query->fetch_assoc()) {
$data = [[$row['xxxx1'],$row['nnnn1'],$nBulto,$row['llll1']]];
$range = "A".$i.":K".$i;
updateFileDoc($driveService,$range,$fileId,$data);
$i++;
}
UpdateFileDoc function
function updateFileDoc($service,$range,$spreadsheetId,$values){
$body = new Google_Service_Sheets_ValueRange([
'values' => $values
]);
$params = [
'valueInputOption' => 'RAW'
];
$result = $service->spreadsheets_values->update($spreadsheetId, $range,
$body, $params);
return $result->getUpdatedCells();
}