YouTube订阅:插入失败,错误400

问题描述 投票:0回答:1

我想订阅一个特定的频道,为了实现这个我使用他们的official docs。首页上有一个执行按钮:enter image description here

应该证明请求,我授予访问权限后会抛出错误:

    /**
 * 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-api-v3
1个回答
-1
投票

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

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.