403, If-Match or If-None-Match header or entry etag attribute required
Asked Answered
F

1

1

Background Info

I am Using python gdata spreadsheet-api with OAuth2.0 and certificate credentials to access data in a google apps domain

I am trying to insert a row into a spreadsheet using

spreadSheetClient = SpreadsheetsClient()
# Certificate Authentication  ....
spreadSheetClient.add_list_entry(list_entry=list_entry, spreadsheet_key=spreadSheetKey,
                                                     worksheet_id=workSheetId)

where list_entry is an instance of gdata.spreadsheets.data.ListEntry and spreadsheetKey and worksheetId are instances of str

I am getting the following error

  File "/home/gautam/Projects/osflow/build/runtime/gdata/spreadsheets/client.py", line 450, in update_cell
    **kwargs)
  File "/home/gautam/Projects/osflow/build/runtime/gdata/client.py", line 730, in update
    desired_class=entry.__class__, **kwargs)
  File "/home/gautam/Projects/osflow/build/runtime/gdata/client.py", line 319, in request
    RequestError)
RequestError: Server responded with: 403, If-Match or If-None-Match header or entry etag attribute required

How do I fix this ?

Faction answered 28/11, 2013 at 16:9 Comment(0)
K
2

ListFeed appends rows, rather than inserts them and columns want a column header (I think the header is required).

For an example of how to use list feed, look at http://gdata-java-client.googlecode.com/svn-history/r51/trunk/java/sample/spreadsheet/list/ListDemo.java

I have not used list feed that often, but it feels very much like using SQL, where you filter/append etc. I tend to use Cell Feed instead.

Knackwurst answered 28/11, 2013 at 21:45 Comment(2)
So Is there a way to use this to insert the header (first row ) ?Faction
CellFeed will let you add a header row. If I remember correctly, CellFeed is the only way this can be done with GData style spreadsheet API. Google-Apps-Script can update and insert rows.Knackwurst

© 2022 - 2024 — McMap. All rights reserved.