I want to use the Youtube Data API to like comments. When I try to like a comment from myself it works without any problem, but when I try to like a comment from someone else I get an error.
"reason": "invalidCommentMetadata",
"message": "The request metadata is invalid.",
I am using the Google API PHP Client.
This is the code that I use to update the like:
$videoComments = $youtube->comments->listComments('snippet', array(
'id' => $comment->id
));
$videoComments[0]->snippet->viewerRating = 'like';
$videoCommentUpdateResponse = $youtube->comments->update('snippet', $videoComments[0]);
I believe this is the way to do this, because when I look at the docs the only thing that I can find that affects the like is the `viewerRating.
https://developers.google.com/youtube/v3/docs/comments#properties
snippet.viewerRating string The rating the viewer has given to this comment. Note that this property does not currently identify dislike ratings, though this behavior is subject to change. In the meantime, the property value is like if the viewer has rated the comment positively.
The value is none in all other cases, including the user having given the comment a negative rating or not having rated the comment.
Valid values for this property are: - like - none
I don't know if I do something wrong, or if this is even possible. I hope someone can help me out here.