Youtube Data API V3:插入对评论的回复 [英] Youtube Data API V3: Insert a reply to a comment

查看:64
本文介绍了Youtube Data API V3:插入对评论的回复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道是否可以回复评论线程的回复...

I couldn't find out whether it's possible to respond to replies of a Comment Thread or not...

我收到一个错误:

{
 "error": {
  "errors": [
   {
    "domain": "youtube.comment",
    "reason": "operationNotSupported",
    "message": "Not all comments can be replied to. Check the comment threads canReply field.",
    "locationType": "other",
    "location": "body.snippet"
   }
  ],
  "code": 400,
  "message": "Not all comments can be replied to. Check the comment threads canReply field."
 }
}

我的要求是这样的:

POST https://www.googleapis.com/youtube/v3/comments?part=snippet&key={YOUR_API_KEY}

POST https://www.googleapis.com/youtube/v3/comments?part=snippet&key={YOUR_API_KEY}

{
 "snippet": {
  "parentId": "ID of the comment to reply to",
  "textOriginal": "Hello World!"
 }
}

否则,您可以获取评论的主题并发送以 +PersonToReplyTo 开头的评论...

Else you could get the thread of the comment and send a comment beginning with +PersonToReplyTo...

推荐答案

这已经晚了几年,但对于任何想知道的人来说,OP 在考虑这个问题时是错误的.要回复您不指定您正在回复的回复的评论 ID,您指定父评论的评论 ID 并在技术上回复该评论,但由于回复按时间顺序显示,它看起来好像你如果您的评论文本是这样的,请重新回复最新回复.

This is a few years late, but for anyone wondering, the OP was thinking about this problem wrong. To reply to a reply you don't specify the comment id of the reply you're replying to, you specify the comment id of the parent comment and technically reply to that but because the replies show up chronologically it will look as if you're replying to the latest reply if that's how your comment text reads.

可选:如果A发布了原始评论,而B发布了您要回复的回复,请指定A的评论ID,然后将您的回复格式设置为+[B的用户名] [您的回复text]"就像在他们的帖子末尾提到的OP一样.

Optional: If person A posted the original comment, and person B posted the reply that you want to reply to, specify the comment id of person A, and then format your reply like "+[person B's uername] [your reply text]" like OP mentioned at the end of their post.

这篇关于Youtube Data API V3:插入对评论的回复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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