youtubeAnalytics.reports.query返回403禁止

时间:2013-08-15 19:25:16

标签: youtube-api

作为 contentOwner ,我正在尝试使用Google API资源管理器运行查询,作为回报,我禁止403,以下是重现此问题的步骤:

  1. 使用collectivedigitalstudios@gmail.com
  2. 登录google.com
  3. 转到API资源管理器并输入所需的参数(https://developers.google.com/apis-explorer/#p/youtubeAnalytics/v1/youtubeAnalytics.reports.query?ids=contentOwner%253D%253DCollective&start-date=2013-08-01&end-date=2013-08-02&metrics=views&filters=channel%253D%253DUCYjk_zY-iYR8YNfJmuzd70A&_h=1&
  4. 授权请求的范围:
    1. https://www.googleapis.com/auth/yt-analytics-monetary.readonly
    2. https://www.googleapis.com/auth/yt-analytics.readonly
  5. 执行
  6. 这是完整的请求/回复:

    youtubeAnalytics.reports.query执行14分钟前执行时间:796 ms

    您无权执行此方法。

    请求

    GET https://www.googleapis.com/youtube/analytics/v1/reports?ids=contentOwner%3D%3DCollective&start-date=2013-08-01&end-date=2013-08-02&metrics=views&filters=channel%3D%3DUCYjk_zY-iYR8YNfJmuzd70A&key={YOUR_API_KEY}
    
    Authorization:  Bearer ya29.AHES6ZQM1y53hLCD4uBa5BSjACg1Pr8NK4WmUUm_jyuxKYhVqA
    X-JavaScript-User-Agent:  Google APIs Explorer
    

    响应

    403 Forbidden
    
    - Hide headers -
    
    cache-control:  private, max-age=0
    content-encoding:  gzip
    content-length:  118
    content-type:  application/json; charset=UTF-8
    date:  Thu, 15 Aug 2013 18:21:38 GMT
    expires:  Thu, 15 Aug 2013 18:21:38 GMT
    server:  GSE
    
    {
     "error": {
      "errors": [
       {
        "domain": "global",
        "reason": "forbidden",
        "message": "Forbidden"
       }
      ],
      "code": 403,
      "message": "Forbidden"
     }
    }
    

    我打开了一个错误,它被关闭为“WorksForMe”。好吧,它没有。

    有什么建议吗?

1 个答案:

答案 0 :(得分:0)

你可以试试这个:

https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3D<YOUR_CHANNEL_ID>&start-date=2013-12-30&end-date=2014-01-05&metrics=views%2Cuniques%2Clikes%2Cdislikes%2Ccomments%2Cshares&dimensions=day&filters=video%3D%3D<YOUR_VIDEO>&sort=-day

并添加范围: https://www.googleapis.com/auth/youtube