Admin SDK Directory APIを使用しようとしています。具体的には、 Users: get endpointで詳細に説明されているユーザー情報を取得します。
oauthing 時に次の権限を要求しました
https://www.googleapis.com/auth/admin.directory.user
https://www.googleapis.com/auth/admin.directory.user.readonly
ただし、特定のユーザーに関する情報を取得するリクエストを行うと、次の応答が返されます。
HTTP/1.1 403 Forbidden
Content-Type: application/json; charset=UTF-8
Date: Fri, 26 Jul 2013 18:25:29 GMT
Expires: Fri, 26 Jul 2013 18:25:29 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Transfer-Encoding: chunked
{
"error": {
"errors": [
{
"domain": "global",
"reason": "domainCannotUseApis",
"message": "Domain cannot use apis."
}
],
"code": 403,
"message": "Domain cannot use apis."
}
}
API コンソールで Admin SDK を有効にしました。
Google Apps Standard (Free) Edition と Google Apps for Nonprofits Edition でこれを試しましたが、同じエラーが発生します。Admin SDK Directory API には Google Apps for Business アカウントが必要ですか?