因为Youtube Api V2不再支持特定的视频。谁能解释一下如何用youtube api v3给视频点赞?我总是得到以下响应:
Response
400 Bad Request
- Show headers -
{
"error": {
"errors": [
{
"domain": "youtube.part",
"reason": "unexpectedPart",
"message": "contentDetails",
"locationType": "parameter",
"location": "part"
}
],
"code": 400,
"message": "contentDetails"
}
}请求是:
Request
POST https://www.googleapis.com/youtube/v3/activities?part=snippet&key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.AHES6ZQUI8Gn7j93QZBmmdlDe7Ei-iqYseYAKAxyf3qTOHHwDHb-dA
X-JavaScript-User-Agent: Google APIs Explorer
{
"contentDetails": {
"like": {
"resourceId": {
"videoId": "video-id",
"kind": "youtube#video"
}
}
}
}该部分为= snippet
我正在关注这些文档:https://developers.google.com/youtube/v3/docs/activities/insert
发布于 2012-12-29 00:39:58
答案已经在评论中了,但是提升一下:YouTube API v3: Liking a video in Python有更多关于喜欢视频的信息,尽管示例是用Python语言编写的。
重要的是,喜欢视频是通过playlistItems.insert()调用完成的,而不是activities.insert()调用。这是一个常见的困惑来源,我已经要求我们的技术作者尝试在文档中澄清一些事情。
https://stackoverflow.com/questions/13994290
复制相似问题