YouTube 订阅:插入失败,错误 400 [英] YouTube Subscriptions: insert fails with error 400

查看:67
本文介绍了YouTube 订阅:插入失败,错误 400的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想订阅特定频道,为此我使用他们的

I want to subscribe for a specific channel, to achieve this I use their official docs. There is a Execute button right on top page:

这应该是为了演示请求,在我授予访问权限后它会抛出一个错误:

That supposed to demonstrate the request, after I grant access it throws an error:

    /**
 * API response
 */
{
  "error": {
    "errors": [
      {
        "domain": "youtube.subscription",
        "reason": "publisherRequired",
        "message": "The subscription resource specified in the request must use the snippet.resourceId property to identify the channel that is being subscribed to."
      }
    ],
    "code": 400,
    "message": "The subscription resource specified in the request must use the snippet.resourceId property to identify the channel that is being subscribed to."
  }
}

但请求正文包含 snippet.resourceId :

{"0":{"name":"snippet.resourceId.kind","value":"youtube#channel"},"1":{"name":"snippet.resourceId.channelId","value":"UC_x5XG1OV2P6uZZ5FSM9Ttw"}}

推荐答案

我刚刚想通了!为了使它工作,我们必须在 snippet.resourceId.channelId 间隙中插入一个值,即使它已经有一个值.我只是复制/粘贴了相同的值和代码 200,而且我订阅了 google 频道.

I just figured it out! To make it work we have to insert a value into snippet.resourceId.channelId gap, even if it already have one. I just copy/pasted the same value and bum code 200 and I was subscribed to google channel.

这篇关于YouTube 订阅:插入失败,错误 400的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆