Youtube Api Explorer InvideoPromotion禁止访问

时间:2018-11-01 17:26:18

标签: youtube-api youtube-data-api google-apis-explorer

我试图使用Youtube API资源管理器在我的频道上设置视频内宣传,以此作为概念证明,然后再将其写入网络应用。我正在研究从https://developers.google.com/youtube/v3/code_samples/java#add_a_featured_video添加精选视频的Java示例。我无法解决此错误代码:

"error": {
  "errors": [
   {
    "domain": "youtube.common",
    "reason": "forbidden",
    "message": "Access forbidden. The request may not be properly authorized.",
    "locationType": "other",
    "location": "body.invideoPromotion.item.websiteUrl"
   }
  ],
  "code": 403,
  "message": "Access forbidden. The request may not be properly authorized."
 }

这是我的要求:

PUT https://www.googleapis.com/youtube/v3/channels?part=invideoPromotion&key={YOUR_API_KEY}

{
 "invideoPromotion": {
  "defaultTiming": {
   "type": "offsetFromStart",
   "offsetMs": "15001"
  },
  "items": [
   {
    "customMessage": "test message",
    "id": {
     "websiteUrl": "https://google.com",
     "type": "website"
    }
   }
  ],
  "useSmartTiming": true
 },
 "id": "<channel id recieved from earlier request in the java example>"
}

我正在使用Oauth2授权请求,并选择所有可用的youtube范围。错误代码似乎表明存在更多特定于更新频道操作的作用域,但我在文档中只能找到6个常规youtube作用域。

0 个答案:

没有答案