title: YouTube API service account returns 'forbidden 403' when inserting playlist item
body: <p>I'm writing a simple application that takes some new uploads from subscribed channels and adds them to a specified playlist. Service account type is used with following code:</p>
  
  <pre><code>var certificate = new X509Certificate2(certificateFileName, "notasecret", X509KeyStorageFlags.Exportable);
  var serviceInitializer = new ServiceAccountCredential.Initializer(serviceAccountEmail)
  {
          Scopes = new[] { YouTubeService.Scope.Youtube }
  };
  var serviceInitializerInstance = serviceInitializer.FromCertificate(certificate);
  
  var credential = new ServiceAccountCredential(serviceInitializerInstance);
  var youtubeService = new YouTubeService(new BaseClientService.Initializer
  {
          HttpClientInitializer = credential,
          ApplicationName = applicationName
  });
  </code></pre>
  
  <p>I've succeeded in reading all necessary information but when I try to insert item into playlist it always return this error:</p>
  
  <blockquote>
    <p>Error: Google.Apis.Requests.RequestError Access forbidden. The request
    may not be properly authorized. [403] </p>
    
    <p>Errors [
           Message[Access forbidden. The request may not be properly authorized.] Location[ - ] Reason[forbidden] Domain[yo utube.common] ]</p>
  </blockquote>
  
  <p>It seems to be some Core API general error according to <a href="https://developers.google.com/youtube/v3/docs/errors" rel="nofollow">this</a> link.</p>
  
  <p>I've seen a lot of samples and they are all the same. My code is:</p>
  
  <pre><code>var newPlaylistItemClone = new PlaylistItem();
  newPlaylistItem.Snippet = new PlaylistItemSnippet();
  newPlaylistItem.Snippet.PlaylistId = playlist.Id;
  newPlaylistItem.Snippet.ResourceId = new ResourceId();
  newPlaylistItem.Snippet.ResourceId.VideoId = existingPlaylistItem.Snippet.ResourceId.VideoId;
  newPlaylistItem.Snippet.ResourceId.Kind = existingPlaylistItem.Snippet.ResourceId.Kind;
  
  await youTubeService.PlaylistItems.Insert(newPlaylistItem, "snippet").ExecuteAsync();
  </code></pre>
  
  <p>Where <code>newPlaylistItem</code> is an item I want to insert and <code>existingPlaylistItem</code> is existing item from channel uploads playlist. I just copy the values and change the playlist id.</p>
  
  <p>Also, when using API explorer on Google Developers documentation website everything works fine (Web Authorization is used). In Google Developers Console I have all the API's enabled. Maybe the issue is that I'm lacking some info required for service account type?
  Can anyone help me to resolve this issue?</p>
  
  <p>Here's my <a href="https://github.com/JustMeGaaRa/Silent.YouTube.MusicFeed/blob/master/Silent.YouTube.MusicFeed.App/Program.cs" rel="nofollow">GitHub</a> repository with source code. Error occurs on line 235 on request.</p>