Youtube Content ID API has not been used - error 403 - youtube-api

I'm trying to get my content-owner-id for upload videos to other channels that I have, as described here.
I'm using the code below to get content-owner-id: (PHP)
$youtubePartner = new Google_Service_YouTubePartner($this->client);
$contentOwnersListResponse = $youtubePartner->contentOwners->listContentOwners(
array('fetchMine' => true));
$contentOwnerId = $contentOwnersListResponse['items'][0]['id'];
And this is the error I got:
A service error occurred: Error calling GET
googleapis.com/youtube/partner/v1/contentOwners?fetchMine=true:
(403) Access Not Configured. Youtube Content ID API has not been used
in project XXXXXXXXXXXXX before or it is disabled. Enable it by
visiting
console.developers.google.com/apis/api/youtubePartner/overview?project=XXXXXXXXXX
then retry. If you enabled this API recently, wait a few minutes for
the action to propagate to our systems and retry.
I tried to go the the link https://console.developers.google.com/apis/api/youtubePartner/overview?project=XXXXXXXXXX but I get "The API doesn't exist or you don't have permission to access it".
Then I searched on google and find out that I need to become a CMS youtube account (I'm also a youtube partner). I also tried to go to cms.youtube.com and log in with my youtube account but I got:
Your Google Account is not linked with YouTube Content Manager. Please
try a different account or contact your Technical Account Manager for
assistance.
Can anyone explain me how to connect to CMS account?

Based from this thread:
You don't see it in the list auf available APIs, unless your account is connected to a CMS and some time has past... It takes 7-14 days unless the Content ID API is available for your account. This is a information i got from the support, but they told me, that it is an automated step.
Your account needs to be connected with a content owner. Be noted that a content owner and a partnered channel are not the same thing.
From this documentation, to request data from a YouTube Content Owner, you need to set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the content owner ID.
Check these related SO questions:
How do I get revenue reports from a YouTube CMS account using an API (for an MCN)?
Using the YouTube Analytics API with a CMS account

Related

YouTube Data API v3 Queries Per Day quota issue

For years we have used the YouTube search API to provide a simple YouTube fallback for smart-tvs with no native YouTube app available. The Queries Per Day for our registered app has been set to "unlimited" trough all this time AFAIK, and we only use the youtube.search-list API.
Suddenly, three weeks back, access to the search function was no longer working. Turns out the quota for daily queries was set to blank(no number, no nothing). When trying to change it we get "enter a number in the range 0 to ."
First of all we linked the app to a billing account to be able to adjust the quota. But it was still not working. Then we contacted YouTube and filled out a big form to increase the quota. We got reply from YouTube that the quota request was granted. But we are still not able to set/change the quota. I've tried replying to to quota mail, but I guess the mail is not monitored.
We see others have had similar issues, and the solution seems to have been to contact YouTube. But we have not found any way to contact them regarding YouTube data API support queries except here on stackoverflow(we do not have a paid support plan). So we're posting here hoping that anyone from YouTube can respond - or to get tips from users that have been in the same situation.
UPDATE:
We have now tried two things:
* Removing and adding back in YouTube data API v3 in the registered app. Did not help
* Activating YouTube data API v3 on another app we have registered - this gave us a daily quota of 10000(but we would definatly prefer not to have to change to another API key)
UPDATE 2:
Info we left out that might be relevant. We recently went trough a process with Google filling out the "YouTube API Services Form"(a google docs form). We went back and forth with the google team, replacing logos, adding ToS links, changing UI etc. until we got a:
"Thanks for your response to the Audit Form. We will conduct our audit based on the information you provided. We will notify you if additional information is needed or when we completed our review. Thank you for your cooperation."
After this we have heard nothing.
Today we can see that the quota is back to 10000... We did send a second request for quota raise and I also sent a mail to the Audit Form team. Not sure which one did the trick - have received no response. And that's probably the most annoying thing about this - the complete lack of feedback.
I experienced the same issue before in one of my projects and I can tell that your access to Youtube data api has been disabled.
TLDR;
I noticed this first because I got the error below when calling Youtube data API.
{ "error": { "errors": [ { "domain": "usageLimits", "reason": "accessNotConfigured", "message": "Access Not Configured. YouTube Data API has not been used in project <my_project_id> before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=<my_project_id> 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=<my_project_id>" } ]
So I went to the console and checked if the API is enabled (And it was). Then I checked the quota, which I suspect is the issue because I got a blank value in the queries per day. I could still edit the value, but those values didn't take effect. It eventually transitioned to 0 and after that, I can no longer edit it (This is after some editing and refresh).
When I looked at my email, it shows that they sent me an email with the following subject and content.
Subject: [FYI] YouTube disabled your inactive project’s access to YouTube Data API Service
Dear YouTube API Developer,
According to our records, your project has been inactive for the past 90 consecutive days. In accordance with the YouTube API Services Developer Policies (link), we disabled your project’s access to and use of the YouTube Data API Service.
This will not affect other Google API Services that you may have enabled on this project.
For reference, your inactive project number is my_project_number
If you desire to access and use YouTube Data API Service, or believe you were disabled in error, you may complete and submit this form to get in touch with us.
Thanks,
YouTube API Services team
The form was included in the email, but since you haven't received one, here's what you need to do as stated here.
If the API is indeed enabled, then this means that your project’s access to YouTube Data API Service has been disabled.
You should’ve received a notice via email regarding this action, which also contains the steps that need to be taken to regain the project’s access. But just in case you missed it, please fill out and submit the exceptions form below:
https://support.google.com/youtube/contact/yt_api_form?hl=en
The alternative, outright solution is to create a new project where you will get the default 10,000 quota.

YouTube may disable your inactive project's access to the YouTube Data API Service

I was using Youtube Data APIto get youtube video but after getting mail from youtube which says api is disable due to inactive.
Youtube Data api not working since it was disabled by youtube because of inactive for 90 Days. I am not able to call(It is enable in API Console) it even with delete and add new delete back. Please help.
Error shows when i am calling from Web Browsers with api Key i also tried to generate new API key also delete and regenerate new api key but still no luck.
"Access Not Configured. YouTube Data API has not been used in project
264969722993 before or it is disabled. Enable it by visiting
https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=264969722993
then retry. If you enabled this API recently, wait a few minutes for
the action to propagate to our systems and retry."
There are things you can do to try and solve this issue. This first option is to apply for an API exception by filling out this out this form. I've filled out this form and am waiting for a response.
The second option is to create a new project and use that project to generate an API key. Because Google has only disabled access to the Youtube Data API for your current project, the new project's API key should work just fine. I've tried this and can confirm this works. This is probably the more hassle-free option if you have extra projects to spare as Google only allows 10 projects at any point in time.
I'm in the same position, disabled for no calls in 90 days. You can request an exemption but after about 25 back and forth emails it's clear that it is just a smokescreen. After explaining what it's used for they then wanted screenshots, then videos of you using the application, how we use the videos we pull up, and then a shot of the room where it was being used. They even asked who made the video we were looking at (we have no idea!). They want your whole business model and what you do. It was just never ending questions and more stuff to send them. After about 2 1/2 months of slow back and forth, I get a message saying I am out of compliance.
Our application uses YouTube to pull up videos for manufacturers product for research and training in a small training/conference room for internal use only. That's all!
Nothing was out of compliance.
This is the email we received:
Hello ,
We have reviewed your quota extension request for project number
#### and have revoked the allocated quota for your API Client(s) as it is out of compliance on the following YouTube API Services -
Developer Policy:
Policy F. 1 (User Experience - YouTube Look and Feel) Please do not
reply to this email, you may complete and submit this form to re-apply
once the above concern has been addressed.
Thanks, YouTube API Services team
The form link in the email is just a link to start the whole process over again.
According to YouTube policy
If your API Client's quota is reduced or eliminated, you may reapply for quota or a quota extension, and YouTube will review that application based on YouTube’s determination of your expected use of the YouTube API Services.
https://developers.google.com/youtube/terms/developer-policies
I suggest reapplying.
To add to avatarhzh's answer:
If you have already used up your initial cap of max. 12 projects and your channel is a brand account and you do not want to go through the process of applying for more quota/getting back your previous quota, you can also create new projects on a different google account and then add that account to your channel as a manager. It is then possible to access your channel through this new account via the youtube data API.
If your channel is not a brand account yet, you can move your channel to a brand account. This allows you to add different google accounts as managers/co-owners of the channel. Warning: certain things (e.g. comments) cannot be transferred when moving to a brand account.

Unable to OAuth with account that owns YouTube channel

I have a google account that I was previously uploading videos to using the v2 YouTube API. This account I guess has two accounts linked to it, because when I go through OAuth flows I have to choose which account.
The 1st account, the one I setup the API in developer console, gives me the option to authorize YouTube API controls.
The 2nd account, the one that actually is the YouTube channel, only says that I'm giving my application offline access, there is no permissions specified relating to YouTube.
I did my OAuth using the 1st account, since that one actually listed youtube permissions. Got my refresh token and added it to the application. However, when I go to attempt to insert a video to YouTube I get the following error:
Code 401 Unauthorized: youtubeSignupRequired
It's as though I'm not linking at all to the YouTube channel account even though they are both on the same Google account.
Has anyone encountered this before?
By the way, I know with certainty that my API calls work properly, as we were able to upload from the dev environment. The dev account is only a single account though that owns the channel on the same account as the API.
I was able to resolve this.
It turned out I needed to do the OAuth with the 2nd account, the one for the YouTube channel. Despite it not requesting any permissions related to YouTube and only getting offline access, I was able to successfully upload using the refresh token I received.
Definitely a case of the most illogical solution being the correct one.

Youtube Earning Reports and Youtube CMS Account

I am trying to Fetch earning reports for my channel i created.
I have registered my self as a youtube partner, i have linked my adsense account to my channel.
Now, when i try to fetch the Reports for earnings, it shows me insufficient permission.
Somewhere i read, that i should use content owner reports, so i was trying to figure out my content owner id,
i guess that is available on Youtube CMS Account, I guess, correct me if i am wrong.
So when i tried to open https://cms.youtube.com page, it gave me an error
Your Google Account is not linked with YouTube Content Manager. Please try a different account or contact your Technical Account Manager for assistance.
How to contact Technical Account Manager?
My Only need is to get the All the reports Including EARNINGS reports from API for my Channel.
To get earnings reports, you have to be a content owner, kind of network which has content management system. So actually you cannot get such a report.

Using the YouTube Analytics API with a CMS account

I'm getting a 403 Forbidden error when trying to get youtube analytics api data using a CMS account.
Just to confirm, is a CMS account the same thing as a Service account?
I can get analytics data for channels that are owned by the oauth2 user but I get the 403 on any other channels that I have access to through my CMS account but am not the content owner of. (I have Administrator account level on the CMS account and the channels I get 403 error on have "Managed" relationship)
Question: Are there any plans to have youtube.analytics api support for querying channels managed under a CMS account?
It seems that since I can use that account to get all the analytics data for these channels using the CMS UI that I should be able to do the same using the API.
A YouTube Content Management System account is not the same thing as a Service Account. You won't get far with the YouTube APIs if you authenticate as a Service Account, since that Service Account won't have access to any actual YouTube channels. Authenticating as a CMS account, however, will give you what you want.
A lot of this recently made it into production, so let me lay out the full steps here explaining how folks with YouTube CMS access can run YouTube Analytics API reports against the channels and videos they manage.
(Optional) While authorized via OAuth 2 as the CMS account, using both the https://www.googleapis.com/auth/youtube.readonly and https://www.googleapis.com/auth/youtubepartner scopes, make a YouTube Data API v3 channels.list() call with the following parameters: part=snippet,contentDetails, managedByMe=true, maxResults=50, onBehalfOfContentOwner=CONTENT_OWNER_ID. CONTENT_OWNER_ID is the one value that you'll have to hardcode here, and it should be set to the "partner code" for your YouTube CMS account. This will give you back a list of up to 50 channels that your CMS account manages. (If you need more than 50, you'll need to page through the results.) The id of each channel will be returned in channel.id, and other useful information (like the uploads list id, if you want to get the list of videos in that channel) will also be returned.
If you already know the UC... channel id for the channel you want to run reports against, you could skip that step and go directly to the Analytics report.
To run a channel-level report on a managed channel, while authorized as the CMS account, make a YouTube Analytics API request with the following parameters: ids=contentOwner==CONTENT_OWNER_ID, filters=channel==UC..., and then any other report parameters you want.
To run a video-level report, set ids=contentOwner==CONTENT_OWNER_ID and filters=video==VIDEO_ID, where VIDEO_ID is the id of any video in any channel that the CMS account manages.
There are more details about content owner reports in the docs.

Resources