First time using Google API, bit confused at the documentation, wonder if someone could help me.
I am getting this error:
Fatal error: Uncaught exception 'Google_Service_Exception' with message '{ "error": {
"code": 400,
"message": "Invalid value at 'data.values' (type.googleapis.com/google.protobuf.ListValue), \"[{\"Name\":\"a\"}]\"",
"errors": [
{
"message": "Invalid value at 'data.values' (type.googleapis.com/google.protobuf.ListValue), \"[{\"Name\":\"a\"}]\"",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
Checked with the Google API Docs, which says, do this:
$values = array(
array(
// Cell values ...
),
// Additional rows ...
);
$body = new Google_Service_Sheets_ValueRange(array(
'values' => $values
));
$params = array(
'valueInputOption' => $valueInputOption
);
$result = $service->spreadsheets_values->update($spreadsheetId, $range, $body, $params);
I've tried to enter different values in that $value array, but no matter what I try I just get Invalid Value at data.values.