使用YouTube API V3的Android发布评论YouTube视频 [英] Post comments to youtube videos using youtube api v3 Android
问题描述
如何通过我的应用程序上添加特定YouTube视频评论。使用YouTube API V3。
我能得到一个YouTube视频使用这个网址的评论:
的http://gdata.youtube.com/feeds/api/videos/\"+VIDEO_ID+\"/comments?$p$pttyprint=true
任何一个可以指导我如何发表评论。感谢:)
你可以用你管CommentThreads:插入后通过应用您的评论https://developers.google.com/youtube/v3/docs/commentThreads/insert
以下是API调用
公布网址:https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&key={YOUR_API_KEY}
和身体的API调用是:
正文 {片段:{
topLevelComment:{
片段:{
textOriginal:YOUR_COMMENT_HERE,
VIDEOID:VIDEO_ID
}
}
}
}
另外补充不要忘了添加以下范围
https://www.googleapis.com/auth/youtube.force-ssl
How can I add comments on a particular youtube video via my app. Using youtube api v3. I am able to get the comments of a youtube video using this url:
http://gdata.youtube.com/feeds/api/videos/"+VIDEO_ID+"/comments?prettyprint=true
Can any one guide me on how to post comments. Thanks :)
You can use you tube "CommentThreads: insert" to post your comment via app
https://developers.google.com/youtube/v3/docs/commentThreads/insert
following is the api call
Post url : https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&key={YOUR_API_KEY}
And body for the API call is:
Body
{ "snippet":{
"topLevelComment":{
"snippet":{
"textOriginal": "YOUR_COMMENT_HERE",
"videoId": "VIDEO_ID"
}
}
}
}
Also add don't forget to add following scope https://www.googleapis.com/auth/youtube.force-ssl
这篇关于使用YouTube API V3的Android发布评论YouTube视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!