title: 403 Forbidden message when calling the v3 Google Calendar API using a Service Account via OAuth 2.0
body: <p>This is a follow on from my thread about a 401 error when using the Google Calendar API and OAuth2, which can be found <a href="https://stackoverflow.com/questions/10112939/login-required-401-unauthorized-message-when-calling-the-v3-google-calendar-ap">here</a></p>
  
  <p>This contains details of the account setup that leads onto my next question, so I wont repeat myself in this thread.</p>
  
  <p>OK, so when when I call the following code to update a Calendar event I get a 403 forbidden error.</p>
  
  <pre><code>for (Event event : events.getItems())
  {
      event.setSummary("XXX" + event.getSummary());
  
      Event updatedEvent = calendar.events().update(CALENDAR_ID, event.getId(), event).execute();
  }
  </code></pre>
  
  <p>Here is the returned error message:</p>
  
  <pre><code>com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
  {
      "code" : 403,
      "errors" : [ {
          "message" : "Forbidden"
       } ],
      "message" : "Forbidden"
  }
  </code></pre>
  
  <p>What have I tried? Well, I have re-read the (rather poor) Google documentation about Service Accounts, re-checked my API Console account settings, tried changing the code that builds the credential (this leads to other errors so is a regression on my previous thread).</p>
  
  <p>In short, nothing works, so is there anything obvious I am missing?</p>