Youtube API v3 ไม่สามารถตอบกลับหรือให้คะแนนความคิดเห็นใดๆ ได้

ฉันกำลังพยายามแสดงความคิดเห็นและให้คะแนนความคิดเห็นผ่าน API แต่ทรัพยากรนั้นเป็น canRate: false และ canReply: false เสมอ ฉันได้ลองผ่านไคลเอนต์ Google Javascript และ http รับคำขอแล้ว แต่ดูเหมือนว่าจะไม่มีอะไรทำงาน

$http.get('https://www.googleapis.com/youtube/v3/commentThreads', {
    params: {
        key: API_KEY,
        part: 'snippet',
        textFormat: 'plainText',
        videoId: VIDEO_ID,
        order: 'relevance'
    }
}).success(function(response) {
    $scope.comments = response.items;
    $log.debug($scope.comments);

    //var author = item.snippet.topLevelComment.snippet.authorDisplayName;
    //var comment = item.snippet.topLevelComment.snippet.textDisplay;
    //var nextToken = results.nextPageToken;
    //var totalRep = item.snippet.totalReplyCount;
    //var parent = item.snippet.topLevelComment.id;
})
.error(function(error) {
    $log.error(error);
})

นี่คือสิ่งที่ฉันใช้ ฉันสามารถแสดงรายการได้อย่างสมบูรณ์ (แม้จะใช้ v3/comments) แต่ไม่สามารถตอบกลับและให้คะแนนความคิดเห็นได้ นี่คือสิ่งที่ฉันใช้

gapi.client.load('youtube', 'v3', function () {
    $scope.selectedComment.snippet.viewerRating = 'like';

    var request = gapi.client.youtube.commentThreads.update({
        part: "snippet",
        body: $scope.selectedComment
    });

    request.execute(function(response) {
        $log.debug(response);
    });
});

ที่ส่วน body ฉันได้ลองสิ่งนี้แล้ว

body: {
    id: $scope.selectedCommentId,
    'snippet': {
        'viewerRating': 'like'
    }
}

แต่ฉันได้รับข้อผิดพลาดนี้

404 ไม่พบเธรดความคิดเห็นที่ระบุ ตรวจสอบค่าของคุณสมบัติ id ในเนื้อหาคำขอเพื่อให้แน่ใจว่าถูกต้อง


person Robert W. Hunter    schedule 17.02.2016    source แหล่งที่มา


คำตอบ (1)


คุณสามารถเล่นความคิดเห็นซ้ำได้

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

body
{
 "snippet": {
  "parentId": "parentCommentID",
  "textOriginal": "yoursComment"
 }
}

คุณสามารถรับข้อมูลเพิ่มเติมได้ที่นี่ https://developers.google.com/youtube/v3/docs/comments/insert#examples

person Rustam Khisamov    schedule 09.04.2016