问题
I'm essentially using the sample code provided by the docs here but I'm getting an error that reads ArgumentError - unknown keyword: snippet
. Does anyone else have this problem as well? I'm not sure if this is a valid bug but intuitively the sample code they provide should work right?
properties = {
'snippet.parentId': '123',
'snippet.textOriginal': message
}
resource = create_resource(properties)
response = service.insert_comment('snippet', resource)
回答1:
Upon digging through the actual library, I discovered that the way to pass in the snippet part is as follows:
snippet = Google::Apis::YoutubeV3::CommentSnippet.new(parent_id: parent_id, text_original: message)
comment = Google::Apis::YoutubeV3::Comment.new(snippet: snippet)
response = service.insert_comment('snippet', comment)
Hope this saves someone from a huge headache of having to chase through their docs
来源:https://stackoverflow.com/questions/44769985/youtube-api-v3-insert-comment-issue