youtube analytics api error 403, accessNotConfigured - youtube-api

I am trying to execute the java sample code for pulling YouTubeAnalyticsReports.
https://developers.google.com/youtube/analytics/v1/code_samples/java
I get com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "usageLimits",
"message" : "Access Not Configured",
"reason" : "accessNotConfigured"
} ],
I have configured the access for Services-YouTube Analytics API.
When the ran for the first time, a browser came up and I had to give permission for the application to access the data. I have been getting the 403 error after that. I have checked the quota and I have hardly used any.

My fault, I did not have the access turned on for the DataAPI. I was under the impression that I needed only the AnalyticsAPI

You haven't enabled YouTube Analytics API v3 and Data API v3 in your devconsole. Once you enable and wait for 15 minutes, it should work.

Related

livePermissionBlocked error from Youtube liveBroadcast/insert API

When attempting to call the liveBroadcasts/insert API I receive a livePermissionBlocked error. I have two google cloud projects, and both have been verified to be able to use auth/youtube scope. In one project with the same google user I can call that api without any issue. In the other project using the same user I receive livePermissionBlocked error. How can I investigate further why that API fails in one of the google cloud projects?
See below the full error response
{
"error": {
"code": 403,
"message": "The user is blocked from live streaming.",
"errors": [
{
"message": "The user is blocked from live streaming.",
"domain": "youtube.liveBroadcast",
"reason": "livePermissionBlocked",
"extendedHelp": "https://support.google.com/youtube/answer/2853834"
}
]
}
}
Also please note I have verified that the user I am testing with has Youtube streaming enabled. I am able to live stream on Youtube and also using one of my google cloud projects.

How to resolve Youtube Data API errors

Currently our Youtube data API v3 is enabled.
However, we found there was some error while we calling this API.
The screen shows as the following:
Google_Service_Exception : {
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. YouTube Data API has not been used in project 10xxxxxxxxx29 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=10xxxxxxxxx29 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"extendedHelp": "https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=10xxxxxxxxx29"
}
],
"code": 403,
"message": "Access Not Configured. YouTube Data API has not been used in project 10xxxxxxxxx29 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=10xxxxxxxxx29 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
}
}
We try to create a new O Auth 2.0 ID, but the issue was still got same error.
Is there any way to resolve this problem?
Thanks
Google allows for 50000 request per month/per user.So seem your website has high traffic.You can get another API key from your other gmail then put into API settings.Hope this help.

Why youtube-v3-api stopped working?

We are using youtube-v3-api for quite some time now but suddenly it started responding with error 403 saying that the access needs to be enabled.
Here is the error message:
{
"code": 403,
"errors": [
{
"domain": "usageLimits",
"message": "Access Not Configured. YouTube Data API has not been used in project {projectId} before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project={projectId} then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"reason": "accessNotConfigured",
"extendedHelp": "https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project={projectId}"
}
],
"message": "Access Not Configured. YouTube Data API has not been used in project {projectId} before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project={projectId} then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
}
But the api is enabled and it worked for months:
We use the api with oauth2 tokens and with API keys as well but we receive the same error for both.
What can be the problem?
I tried to disable and reenable the API but that didn't help.
Update:
Google support suggested that the issue maybe caused by the daily quota limit which is set to 0.
However we cannot edit this quota as shown in the picture although we have all admin rights to do so.
Does anyone experienced this? How could we raise the quota?
We already filled out a quota limit extension form and waiting for the response but I think we should be able to set to quota to a workable level on the developer console.

Internal server error from YouTube Analytics API

since yesterday we are receiving code 500 errors from the YouTube Analytics API. Nothing has changed in the relevant code since a few months ago, and everything always went smoothly before yesterday.
This is a sample query (but ALL queries to YT Analytics fail):
https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3D<channelid>&metrics=views,averageViewDuration,estimatedMinutesWatched,comments,likes,dislikes,shares,subscribersGained,subscribersLost&dimensions=channel&start-date=2016-06-01&end-date=2016-06-30&start-index=1
(with appropriate channelId and Authorization header set). This is what we are getting back:
{
"code": 500,
"message": "The remote server returned an error: (500) Internal Server Error.",
"response": {
"error": {
"errors": [{
"domain": "global",
"reason": "internalError",
"message": "Unknown error occurred on the server."
}
],
"code": 500,
"message": "Unknown error occurred on the server."
}
}
}
Any clues?
I got the same problem : "Error 500" for any youtube API called (yt-analytics.readonly).
Here is a workaround for fixing the problem :
Add the following right on your application https://www.googleapis.com/auth/youtube.readonly, even if it's not usefull
re-generate the refresh token
everything is fixed
You can even remove the application and add it again wihtout the youtube.readonly right, it's still working. It's like the API got an update by adding this unusefull right.
I have also tested another workaround with the API Test Console, by adding "Google APIs Explorer" application with the youtube.readonly & yt-analytics.readonly unblock the problem and you dont have any "Error 500" with your own token.
Hope this helps and it's clear enought !
It seems it mostly fixed this problem.
I think the problem is on YouTube side.
We are still waiting until they fix 100%.

YouTube Data API V3 - Error Access Not Configured

I have a problem with the use of new YouTube Data API V3.
I'm still using version V2 but I plan to migrate my web application to the new version. After doing some tests with a call using the web browser type:
https://www.googleapis.com/youtube/v3/videos?id=TYkPtAmJn4E&key=*******************&part=snippet,contentDetails,statistics,status
I get the following error:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
I state that the console should be configured correctly, as you can see from the attached images, since it works fine for more than a year with the V2 version of the API.
Can you help me solve this problem?
Thanks.!
You have to create a project, enable Data API v3 from console and use the credentials you create for that project.

Resources