0

My youtube analytics API script works perfectly in the past, but suddenly doesn't work any more. The problem is the json returned does not contain rows fields

{
  'columnHeaders': [
    {
      'name': 'day', 
      'columnType': 'DIMENSION', 'dataType': 'STRING'
    }, 
    {
      'name': '...', 
      'columnType': 'METRIC', 'dataType': '...'
    }, ...
  ], 
  'kind': 'youtubeAnalytics#resultTable'
}

After googling, links below are very similar to my problem

However, either no answer or the solution provided doesn't work for me (my code already contains scope youtube.readonly ['https://www.googleapis.com/auth/youtube.readonly', 'https://www.googleapis.com/auth/ytanalytics.readonly']).

Is there is any status page that I can check if it's a problem at google end or how to check any place that might go wrong?

Thanks

John Todd
  • 111
  • 1
  • 1
  • 9

2 Answers2

0

Try to delete the file: "Google.Apis.Auth.OAuth2.Responses.TokenResponse-..." located in my case at: ".\users\admin\appdata\roamming\YouTubeAnaltycis.Auth.Store"

Regards

José Luis
  • 11
  • 1
  • Thanks but searching with `find . -name Google.Apis.Auth.OAuth2.Responses.TokenResponse\*` or `find . -type f -exec grep Google.Apis.Auth.OAuth2.Responses.TokenResponse\* {} \+` doesn't find any related string. – John Todd Jun 21 '18 at 08:21
  • That is the name I used programming with C.net: "OAuthcredential = GoogleWebAuthorizationBroker.AuthorizeAsync( GoogleClientSecrets.Load(stream).Secrets, new[] { YouTubeAnalyticsService.Scope.Youtube,YouTubeAnalyticsService.Scope.YtAnalyticsReadonly }, user, CancellationToken.None, new FileDataStore("YouTubeAnalytics.Auth.Store")).Result". Do you have a similar code? – José Luis Jun 21 '18 at 10:31
0

enter image description here

You can see in the Reports: Query front page that you need to use the new scope:

https://www.googleapis.com/auth/youtube.readonly

instead of the old one:

https://www.googleapis.com/auth/yt-analytics.readonly 

After changing the scope, perform a re-authentication (delete the old credentials) for the new scope to take effect.

This is also confirmed in this forum.

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56