组合资产创建时的Youtube数据api(Contnet ID)错误

时间:2016-09-15 19:14:13

标签: api youtube youtube-api youtube-data-api composition

我们的应用程序已投入生产2年,并且能够使用YT数据API请求创建所有3个音乐视频资源(音乐视频,录音和合成)。自上周以来,我们收到了关于合成资产创建请求的错误。音乐视频和录音资产创建请求照常正常工作。

YT API错误:

vagrant$ curl -X POST -H "content-type: application/json" -H "user-agent: Yt::Request (gzip)" -H "authorization: Bearer ya29.XXXXXXXX_O3pRQWtbrQ5dHn5BV6SiiGxkawq26LksyUy1LjwtG27Vs9e9-XXXX" -H "host: www.googleapis.com" -H "content-length: 193" -d '{"type":"composition","onBehalfOfContentOwner":"xxxxxxxxxxxxxxxx","metadataMine":{"customId":"9c3e6533a06cac4e","writer":["DeAndre \"Drizzo Man\" White, Daniel Kováč"],"title":"Ready"}}' "https://www.googleapis.com/youtube/partner/v1/assets?onBehalfOfContentOwner=xxxxxxxxxxxxxxxx"
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "forbidden",
    "message": "Forbidden"
   }
  ],
  "code": 403,
  "message": "Forbidden"
 }
}

1 个答案:

答案 0 :(得分:0)

documentation YouTube数据API中说明错误,forbidden (403) error表示:

  

禁止(403) - 禁止访问。请求可能不正确   授权。

因此,请尝试检查您是否在项目中正确实施了OAuth authorization