Google 管理 API で承認し、メーリング リストのユーザーをリストしようとしています。APIコンソールからキーをダウンロードして実行しました:
require 'google/api_client'
client= Google::APIClient.new(application_name: "myapp", application_version: "0.1")
groups= client.discovered_api('admin', 'directory_v1')
key = Google::APIClient::PKCS12.load_key(Dir['*.p12'].first, 'notasecret')
client.authorization = Signet::OAuth2::Client.new(
token_credential_uri: 'https://accounts.google.com/o/oauth2/token',
audience: 'https://accounts.google.com/o/oauth2/token',
scope: 'https://www.googleapis.com/auth/admin.directory.group.readonly',
issuer: '123asdf@developer.gserviceaccount.com',
signing_key: key)
client.authorization.fetch_access_token!
puts client.execute(api_method: groups.users.list, parameters: {}).body
groupKey: "mygroup@googlegroups.com" を追加してみました。 domain: "mysite.com" を設定してみました。
グループ内のユーザーを一覧表示するには、さらに何をする必要がありますか?