Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google spreadsheets API C# missing resource version id on batch update

I'm trying to batch update the empty cells using the spreadsheets api C# v2.2.0.0 this way:

foreach (var csvline in csv)
{
          var csvlineParsed = csvline.Split(';');
          for (uint index = 0; index < csvlineParsed.Length; index++)
          {
                var cellEntry = new CellEntry(i, index + 1, csvlineParsed[index]);
                cellFeed.Insert(cellEntry);

                var cell = new CellEntry(i, index + 1);
                cell.Id = new AtomId(string.Format("{0}/{1}", cellFeed.Self, "R" + i + "C" + index + 1));
                cell.InputValue = csvlineParsed[index];
                cell.BatchData = new GDataBatchEntryData("R" + cell.Row + "C" + cell.Column, GDataBatchOperationType.update);
                batchRequest.Entries.Add(cell);*/

          }
          i++;
}

var batchResponse = (CellFeed) _service.Batch(batchRequest, new Uri(cellFeed.Batch));

but I have the "missing resource version id" error

like image 965
Velikodniy Avatar asked Jan 27 '26 23:01

Velikodniy


1 Answers

Another way I solved this is through adding an additional HTTP header

If-Match: *

Which says overwrite anything.

like image 139
Andy Jones Avatar answered Jan 30 '26 16:01

Andy Jones



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!