Youtube Data API V3: Insert a reply to a comment

ε祈祈猫儿з 提交于 2021-02-10 12:57:44

问题


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

I get an Error:

{
 "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."
 }
}

My request was like this:

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!"
 }
}

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


回答1:


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.

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.



来源:https://stackoverflow.com/questions/36983547/youtube-data-api-v3-insert-a-reply-to-a-comment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!