YoutubeAnalytics icon indicating copy to clipboard operation
YoutubeAnalytics copied to clipboard

Access to the resource is forbidden

Open Judahoo opened this issue 2 years ago • 3 comments

Hello again,

I was working with your script and all of a sudden I am getting "Access to the resource is forbidden." I tried clearing the permissions and relogging in but it does not seem to make a difference.

I am able to get to Load the Source image

But when I do the Navigation to Videos it throws this error "Expression.Error: Access to the resource is forbidden".

image

Any advice would be appreciated.

Judahoo avatar Jan 20 '22 21:01 Judahoo

I just tried reinstalling the connector and starting in a new window and it is giving me the same error.

image

truly Bizzard as it works for Channel info and Countries

image

Judahoo avatar Jan 20 '22 21:01 Judahoo

Hey! Unfortunately, I don't have an app running to test things at the moment or for the next few months.

My best suggestion would be to check what response you're getting from the API with something like Fiddler to see if there's something at your application level that's preventing you from accessing those endpoints. The error that you're getting is always related to unauthorized access, in other words, you don't have the right access to get that data somehow and the only place that defines what data you can gain access to is the application. The application only defines what scopes to use in order to get the data from the API (which is stated as a requirement by the API).

You can check the scopes used in this custom connector from these lines of code: https://github.com/migueesc123/YoutubeAnalytics/blob/c32e1380097cf1dcbc0b739ce20579628ef88791/YoutubeAnalytics/YoutubeAnalytics.pq#L27-L31

I'll leave this issue open for a few days just to check if anyone else is having the same issue.

migueesc123 avatar Jan 20 '22 22:01 migueesc123

It appears like it was a permission issue, not really sure what it was but I managed to fix the issue by disabling the 3 YouTube APIs in YouTube Console, ran the connector (it crashed as predicted, 403 errors). I then re-enabled the YouTube APIs in YouTube Console and voila, it worked.

Judahoo avatar Jan 21 '22 16:01 Judahoo