title: How to attach access token to a google calendar API request
body: <p>Several documents on authorizing Google APIs reference attaching an access token without giving an unambiguous example. The request I generate is:</p>
  
  <pre><code>https://www.googleapis.com/calendar/v3/calendars/mtnmath@mtnmath.com/events?ya29.1.AADtN
  </code></pre>
  
  <p>I have deleted most of the access token in the above line.
  This token was obtained successfully with:</p>
  
  <pre><code>$client-&gt;addScope("https://www.googleapis.com/auth/calendar");
  
  $client-&gt;addScope("https://www.googleapis.com/auth/calendar.readonly");
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$_SESSION['access_token'] = $client-&gt;getAccessToken();
  </code></pre>
  
  <p>in php. The token was taken from a structure with json_decode on <code>$client-&gt;getAccessToken();</code></p>
  
  <p>I am not sure the problem is attaching the token but it is one thing I am concerned about. The result was "403 Forbidden". I would appreciate any suggestions.</p>