title: Google.Apis.Requests.RequestError Insufficient Permission [403]
body: <p>I am getting below error, I wanted to get all the comments posted on a youtube video. </p>
  
  <p>So basically I am passing video id and I wanted to get all the comments associated with that video</p>
  
  <blockquote>
    <p>Google.Apis.Requests.RequestError<br>
    Insufficient Permission [403]</p>
    
    <p>Errors [Message[Insufficient Permission] Location[ - ] Reason[insufficientPermissions] Domain[global]]</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>protected void btnGetVideoDesc_Click(object sender, EventArgs e)
  {
      string videoId = txtVideoID.Text;
      YoutubeVideo video = new YoutubeVideo(videoId);
      lblTitle.Text = video.title;
      lblPublishedDate.Text = video.publishdate.ToShortDateString();
  }
  
  public class YoutubeVideo
  {
      public string id, title, description ;
      public DateTime publishdate;
  
      public YoutubeVideo(string id)
      {
          this.id = id;
          YoutubeAPI.GetVideoInfo(this);
      }
  }
  
  public class YoutubeAPI
  {
      private static YouTubeService ytService = Auth();
  
      private static YouTubeService Auth()
      {
          UserCredential creds;
          var service = new YouTubeService();
          try
          {
              using (var stream = new FileStream(@"C:\v-mmarat\Project\EMEA_Development\YoutubeWebCrawling\YoutubeWebCrawling\youtube_client_secret.json", FileMode.Open, FileAccess.Read))
              {
                  creds = GoogleWebAuthorizationBroker.AuthorizeAsync(GoogleClientSecrets.Load(stream).Secrets,
                      new[] { YouTubeService.Scope.YoutubeReadonly }, "user", CancellationToken.None,
                      new FileDataStore("YoutubeAPI")
                      ).Result;
              }
             service = new YouTubeService(new BaseClientService.Initializer()
             {
                 HttpClientInitializer = creds,
                 ApplicationName = "YoutubeAPI",
                 ApiKey = "My_API_Key"
  
             });
          }
          catch (Exception e)
          { }
          return service;
      }
  
      public static void GetVideoInfo(YoutubeVideo video)
      {
          try
          {
             //This code work perfectly 
              var videoRequest = ytService.Videos.List("snippet");
  
              videoRequest.Id = video.id;
  
              var response = videoRequest.Execute();
              if (response.Items.Count &gt; 0)
              {
                  video.title = response.Items[0].Snippet.Title;
                  video.description = response.Items[0].Snippet.Description;
                  video.publishdate = response.Items[0].Snippet.PublishedAt.Value;
              }              
  
  
  
  
          else
              {
                  //error
              }
  
              var CommentRequest = ytService.Comments.List("snippet");
  
              videoRequest.Id = video.id;
  
              //Getting error at this line after CommentRequest.Execute();
              var Commentresponse = CommentRequest.Execute();
              if (Commentresponse.Items.Count &gt; 0)
              {
                  video.title = Commentresponse.Items[0].Snippet.ChannelId;
                  video.description = Commentresponse.Items[0].Snippet.TextDisplay;
                  video.publishdate = Commentresponse.Items[0].Snippet.PublishedAt.Value;
              }
              else
              {
                  //error
              }
          }
          catch (Exception e)
          { }
      }
  </code></pre>