我想订阅一个特定的频道,为了达到这个目的,我使用他们的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"}}