asimlqt / php-google-spreadsheet-client

A PHP library for accessing and manipulating Google Spreadsheets
Other
543 stars 154 forks source link

Doesn't UPDATE or INSERT on ListFeed #95

Closed dfoxx closed 9 years ago

dfoxx commented 9 years ago

I'm guessing this has something to do with recent updates to Drive API and Sheets API for Google, but the examples don't appear consistent with the XML requests sent from this client. I receive following error:

PHP Fatal error:  Uncaught exception 'Google\Spreadsheet\Exception' with message 'Error in Google Request' in ...vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/DefaultServiceRequest.php:256
Stack trace:
#0 ...vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/DefaultServiceRequest.php(152): Google\Spreadsheet\DefaultServiceRequest->execute(Resource id #59)
#1 ...vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/ListFeed.php(82): Google\Spreadsheet\DefaultServiceRequest->post('https://spreads...', '<entry xmlns="h...')
#2 ...cron.php(29): Google\Spreadsheet\ListFeed->insert(Array)
#3 {main}
  thrown in ...vendor/asimlqt/php-google-spreadsheet-client/src/Google/Spreadsheet/DefaultServiceRequest.php on line 256

Output from this client:

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended">
  <id>https://spreadsheets.google.com/feeds/list/key/worksheetId/private/full/rowId</id>
  <gsx:name><![CDATA[Bingley]]</gsx:name>
  <gsx:hours><![CDATA[20]]</gsx:hours>
  <gsx:items><![CDATA[4]]</gsx:items>
  <gsx:ipm><![CDATA[0.0033]]</gsx:ipm>
</entry>

Example from Google:

<entry gd:etag='"S0wCTlpIIip7ImA0X0QI"'>
  <id>https://spreadsheets.google.com/feeds/list/key/worksheetId/private/full/rowId</id>
  <updated>2006-11-17T18:23:45.173Z</updated>
  <category scheme="http://schemas.google.com/spreadsheets/2006"
    term="http://schemas.google.com/spreadsheets/2006#list"/>
  <title type="text">Bingley</title>
  <content type="text">Hours: 10, Items: 2, IPM: 0.0033</content>
  <link rel="self" type="application/atom+xml"
    href="https://spreadsheets.google.com/feeds/list/key/worksheetId/private/full/rowId"/>
  <link rel="edit" type="application/atom+xml"
    href="https://spreadsheets.google.com/feeds/list/key/worksheetId/private/full/rowId/version"/>
  <gsx:name>Bingley</gsx:name>
  <gsx:hours>20</gsx:hours>
  <gsx:items>4</gsx:items>
  <gsx:ipm>0.0033</gsx:ipm>
</entry>