title: Getting new accesstoken using the refreshtoken already retrieved in googledrive api
body: <p>I am using Gooogledrive Api with php.Using it I have retrieved Refresh token from credentials part.The accesstoken expires after 3600 seconds.My question is how to get the new accesstoken from this refresh token.I have used the method given in Google php client library.I have called the refreshtoken('refreshtoke') function of apiclient.My code is following</p>
  
  <pre><code>$client = new apiClient();
  $client-&gt;setClientId('my-client-id');
  $client-&gt;setClientSecret('my client-secret-key');
  $client-&gt;setRedirectUri('my redirect uri');
  
  
  
  $client-&gt;refreshToken('MY-retrieved-refresh-token');
  </code></pre>
  
  <p>But I get the following error:-
   <strong>Uncaught exception 'apiAuthException' with message 'Error refreshing the OAuth2 token, message: '{ "error" : "invalid_grant" }</strong>.**</p>
  
  <p>Please help me .Everything rest works fine.But accesstoken expires after 3600 seconds and is not refreshing</p>