title: Google Calendar API - can only update event once
body: <p>I've encountered the same problem as described in this post:</p>
  
  <p><a href="https://stackoverflow.com/questions/8574088/google-calendar-api-v3-re-update-issue">Google Calendar api v3 re-update issue</a></p>
  
  <p>Namely, once I create an event and update it once using the Google Calendar API (v3), I am no longer able to update the event.  When I attempt to, I get a 400 - Invalid value response. (FWIW I'm working in PHP).</p>
  
  <p>Following a lead offered in the post I referenced above, I attempted to solve the issue using etags (though admittedly my grasp of how they work is limited).  Basically, on event update, the API returns an etag in its response, which I now save in my database.  Then for subsequent (n > 1) updates, I pull the current etag from the database and include it in the http header:</p>
  
  <pre><code>Content-Type:  application/json
  Authorization:  OAuth [token]
  If-Match: [etag]
  </code></pre>
  
  <p>This follows info under the "Updating Entries" header here: <a href="http://code.google.com/apis/gdata/docs/2.0/reference.html#ResourceVersioning" rel="nofollow noreferrer">http://code.google.com/apis/gdata/docs/2.0/reference.html#ResourceVersioning</a></p>
  
  <p>Sidenote: in the google ref above, the If-Match header is shown as</p>
  
  <pre><code>If-Match: "S0wCTlpIIip7ImA0X0QI"
  </code></pre>
  
  <p>with double quotes around the etag. I'm saving the etags in the database with double quotes, exactly as I receive them in first update response.  Do I need to escape the quotes or anything when adding to the header using curl_setopt/HTTPHEADER?</p>
  
  <p>Despite implementing this etag If-Match thing, I'm still getting the same 400 - Invalid value response.  I know that my request bodies are valid because the first update works fine.  There's just some additional issue surrounding subsequent updates.</p>
  
  <p>Any help much appreciated.</p>