I'm trying to use Google.Apis.Sheets.v4 in a C# console application just to insert some rows in a sheet.
I've followed the example at official Google API Sheets site. To get informations, it works fine. But I can not put information on this sheet. I found this error all the times that I've tried:
Invalid JSON payload received. Unknown name "e_tag" at 'data': Cannot find field.
Here a part of the code that I'm using:
/*...
Authentication part
*/
String spreadsheetId = "SPREADSHEET_ID";
String range = "Sheet1!A1:A250";
SpreadsheetsResource.ValuesResource.GetRequest request =
service.Spreadsheets.Values.Get(spreadsheetId, range);
ValueRange response = request.Execute();
IList<IList<Object>> values = response.Values;
var vr = new ValueRange()
{
ETag = "123456",
MajorDimension = "COLUMNS",
Range = "Sheet1!B2:B250",
Values = values
};
var request2 = service.Spreadsheets.Values.Append(vr, spreadsheetId, "Sheet1!B2:B250");
var inseriu = request2.Execute(); // the error occurs at this point
Any ideas?