My pain with google api continues...
I\'m able to use a script to use a refresh token - automatically refresh and keep my access to a calender alive. I can interact with
OK - Based on a couple of posts I've fixed the problem of getting the refresh token to get a new access token. I used this code before I started to attempt any access:
if($client->isAccessTokenExpired()) {
echo 'Access Token Expired'; // Debug
$client->refreshToken('X/XXXXXX');
}
Where the blanked out part in refreshToken
is my refresh token. I hard coded the key into the code.
This is probably not the correct solution as I've seen references to storing the key in a database, so presumably I could store the current access token in a db with the refresh token and pull these form the db as and when required to save hard coding them?
Hopefully this method I've used will work again after it expires - fingers crossed!