问题
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