Обновить токен доступа с помощью Google Analytics API [закрыто]
Я пытаюсь обновить токен доступа с помощью Google Analytics API (php), но я всегдаinvalid_grant error ... это мой процесс:
1. I save a first acces token in my database with a offline request, the response is:
{"access_token":"ya29.AHES6ZSPMUyKfx06Bw89LnlfRa5mEmwdthyCUj6D7bRmDcQ","token_type":"Bearer","expires_in":3600,"refresh_token":"1\/1XLO8PLs2Pb0NPs-T-lt07jWW_STBWYG3IGRB08ZbkA","created":1338810086}
2. I check the token info, if "expires_in" < 0 i try to refresh my token:
if ($infoAt['expires_in'] <= 0) {
$row = $database->loadObject("SELECT refresh from token WHERE id=1");
$client->refreshToken($row['refresh']);
}
и у меня ошибка invalid_grant ...
любая помощь ? Большое спасибо и извините за мой английский ...