이 documentation에서, 당신은 응답을 검색해야하는 주석의 ID를 지정하는 parentId
매개 변수를 사용할 수 있습니다. YouTube는 현재 최상위 수준의 댓글에 대해서만 답장을 지원하고 답변에 대한 답장은 향후 지원 될 수 있습니다. comments.list
메소드를 사용하여 댓글 답글을 검색 할 수 있습니다.
예 :이 관련 thread에
//Call the YouTube Data API's comments.list method to retrieve existing comment replies.
V3CommentListResponse commentsListResponse = youtube.comments().list("snippet")
.setParentId(parentId).setTextFormat("plainText").execute();
List<Comment> comments = commentsListResponse.getItems();
if (comments.isEmpty()) {
System.out.println("Can't get comment replies.");
} else {
// Print information from the API response.
System.out.println("\n===========Returned Comment Replies============\n");
for (Comment commentReply : comments) {
snippet = commentReply.getSnippet();
System.out.println(" - Author: " + snippet.getAuthorDisplayName());
System.out.println(" - Comment: " + snippet.getTextDisplay());
System.out.println("\n---------------\n");
}
Comment firstCommentReply = comments.get(0);
firstCommentReply.getSnippet().setTextOriginal("updated");
Comment commentUpdateResponse = youtube.comments()
.update("snippet", firstCommentReply).execute();
// Print information from the API response.
System.out.println("\n============Updated Video Comment===============\n");
snippet = commentUpdateResponse.getSnippet();
System.out.println(" - Author: " + snippet.getAuthorDisplayName());
System.out.println(" - Comment: " + snippet.getTextDisplay());
System.out.println("\n--------------------------------\n");
확인합니다.