【问题标题】:YouTube Subscriptions: insert fails with error 400YouTube 订阅:插入失败并出现错误 400
【发布时间】:2023-03-26 02:46:01
【问题描述】:

我想订阅一个特定的频道,为此我使用他们的official docs。在首页右侧有一个执行按钮

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

    /**
 * 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"}}

【问题讨论】:

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


【解决方案1】:

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

【讨论】:

  • 我也面临同样的问题! 2020年可以去看看吗? :D
猜你喜欢
  • 2020-12-28
  • 2016-03-12
  • 2014-08-02
  • 1970-01-01
  • 1970-01-01
  • 2020-09-26
  • 2017-09-11
  • 2020-10-10
  • 1970-01-01
相关资源
最近更新 更多