Google Spread Sheetをプログラムから操作

昔作ってたスプレッドシートからデータを取得するプログラムが動かなくなってた。
2015年5月に昔の認証方法が使えなくなり、
OAuth2.0だけになったとか。

指定方法を忘れていたのでメモ。

GoogleのAPI Managerで該当のOAuth 2.0 クライアント IDを探す
https://console.developers.google.com/apis/credentials

クライアントID名をクリックすると詳細が表示され、

サービス アカウント
{アカウント名}
{hogehoge}@developer.gserviceaccount.com

というメールアドレス形式の表示が出る。
このメールアドレスをコピーし、
取得したいスプレッドシートで「共有」ボタンからメールアドレスを追加。

これで、このクライアントの認証で
特定のスプレッドシートにアクセスが可能になる。

You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

コメントを残す

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

CAPTCHA