私はExplorerを使用してAPIをテストし、返されたデータの感触を得ています。各APIの右上には、「使用許可」スイッチがあります。これは、私のGoogleアカウントでの認証を求めます。これはすべて正しく、エラーなく行われます。私は "data.ga.get" メソッドを使用しようとすると、私はこのエラーを取得:Google API Explorer - Google Analytics - v3 - "401 Unauthorized"
要求
をhttps://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A24351574&start-date=2011-01-01&end-date=2012-02-01&metrics=ga%3Apageviews&pp=1&key= {YOUR_API_KEY}
要求
がhttps://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A24351574&start-date=2011-01-01&end-date=2012-02-01&metrics=ga%3Apageviews&pp=1&key= {YOUR_API_KEY}
をゲットAuthorization: OAuth ya29.AHES6ZSCqka0X1AVtMrW7iXn7VreLk71vfWB9MrnXCejBYY
X-JavaScript-User-Agent: Google APIs Explorer
Response
403 Forbidden
cache-control: private, max-age=0
content-type: application/json; charset=UTF-8
date: Tue, 28 Feb 2012 01:23:18 GMT
expires: Tue, 28 Feb 2012 01:23:18 GMT
server: GSE
{
"error": {
"errors": [
{
"message": "Forbidden"
}
],
"code": 403,
"message": "Forbidden"
}
}
奇妙なことに、authはカレンダーのような他のAPIでうまく動作します。 私はこの問題が起こる可能性があるのか分かりません