https://groups.google.com/forum/#!topic/adsense-api/tS_3G9OC8Eg
Google UK Limited에 근무하는 "Sérgio Gomes"가 service account로 AdSense Management API를 호출하는 것은 불가능하다고 했다.
you can't use service accounts with the AdSense Management API, since it accesses protected user data
https://stackoverflow.com/a/37303865/262425 에서도 불가능하다고 했고,
https://developers.google.com/adsense/management/getting_started 에서도
참고: 서비스 계정은 보호된 데이터에 액세스하므로 지원되지 않습니다.
라고 해서 service account로 adsense api를 호출하는 것은 앞으로 시도 안 하는 걸로.
cron 에서 사람의 개입없이 adsense 정보를 가져오게 하고 싶다면
- 사람이 개입해서 access_token, refresh_token을 얻은 다음에 쓰고,
- access_token이 만료되었다면 refresh_token으로 access_token을 새로 가져오게 하고,
- refresh_token 이 만료되었다면 다시 처음으로 돌아가게 해서
쓴다. 사람의 개입없이 자동화하기는 (아는 한) 불가능하다.