Any used Google API for Drive?

Soldato
Joined
27 Dec 2005
Posts
17,310
Location
Bristol
So I've gone through the whole auth process to access Drive etc from a web app. All fine, can pull data off a spreadsheet no problem. But I'm having a mare updating/adding data to said spreadsheet.

Even Google's own documentation seems to differ, with one page stating $result = $service->spreadsheets_values->update($spreadsheetId, $range, $body, $params); and another dropping the $params requirements. They don't give any real world examples (at https://developers.google.com/sheets/api/guides/values) which is really annoying for a fairly amateur coder like me.

Can anyone point me in the right direction?
 
Thanks, in usual fashioned I just managed about to find the answer after posting...

Code:
$service = new Google_Service_Sheets($client);
$range = 'E' . $actualrow;
$visitvalues = [[$date,],];
$body = new Google_Service_Sheets_ValueRange(['values' => $visitvalues]);
$valueInputOption = array('USER_ENTERED');
$params = ['valueInputOption' => $valueInputOption];
$response = $service->spreadsheets_values->update($spreadsheetId, $range, $body, $params);


Works like a charm!
 
Back
Top Bottom