Add comment on YouTube for video from iPhone app

| | August 7, 2015

How can I programmatically add comments to a YouTube video from an iPhone app? I’ve searched Google and gone through the YouTube Api but haven’t found any help.

One Response to “Add comment on YouTube for video from iPhone app”

  1. Adding comment using Youtube API

    Adding a comment in response to a video
    To add a comment to a video, send a POST request to the URL identified in the tag that appears inside the tag. The actual comment that you are submitting appears as the value of the tag in the XML that constitutes the body of the POST request.
    The sample XML API request below demonstrates how to add a comment to a video.

    POST /feeds/api/videos/VIDEO_ID/comments HTTP/1.1
    Host: gdata.youtube.com
    Content-Type: application/atom+xml
    Content-Length: CONTENT_LENGTH
    Authorization: AuthSub token="AUTHORIZATION_TOKEN"
    GData-Version: 2
    X-GData-Key: key=DEVELOPER_KEY
    

    <?xml version="1.0" encoding="UTF-8"?>
    <entry xmlns="http://www.w3.org/2005/Atom"
        xmlns:yt="http://gdata.youtube.com/schemas/2007">
      <content>This is a crazy video.</content>
    </entry>
    

    construct that xml and send via POST. Get Developer_key, get the VIDEO_ID of the youtube video.

    Using a developer key:
    A developer key uniquely identifies a product that is submitting an API request. Please visit http://code.google.com/apis/youtube/dashboard/ to obtain a developer key.

    VideoID – The YouTube video ID that uniquely identifies the video.
    I think videoid for a youtube video http://www.youtube.com/watch?v=NWHfY_lvKIQ is NWHfY_lvKIQ

Leave a Reply