Post comments to youtube videos using youtube api v3 Android

被刻印的时光 ゝ 提交于 2019-12-01 07:34:12

问题


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

How can I post comments?


回答1:


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



来源:https://stackoverflow.com/questions/27792340/post-comments-to-youtube-videos-using-youtube-api-v3-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!