Need help obtaining Content Owner Id - youtube-api

I'm struggling with retrieving the Content Owner-based YouTube Analytics Data. From this discussion (Obtaining the current user's YouTube content owner id), I learned that I need to query youtubePartner.contentOwners.list(fetchMine=true) to obtain the content owner info, of which the Id will be found.
My struggle is that when I call youtubePartner.contentOwners.list(fetchMine=true), I receive the reason "accessNotConfigured". I'm not sure why: I have YouTube Analytics enabled in the APIs Console for my app, and I have the https://www.googleapis.com/auth/youtubepartner scope configured in OAuth2 list of scopes during authentication.
Can anyone help me understand what I'm doing wrong?

You may have not enabled Partner API in your devconsole or your account may not be linked to a CMS account.

Related

Getting YouTube Content ID API

YouTube Content ID API is not showing up on my api console, I already made sure my channel was partnered, I also linked it the CMS account, everything is setup correctly but, when I go to the API console it does not show it. The channel I'm uploading the videos to is a brand account of the main email, is that the problem? if so how can I fix it. Thanks.
To get access to YouTube Content ID API you first need to apply here.
https://www.youtube.com/content_id_signup?internalcountrycode=GB
You must be a partner to apply.

What are the requirements for using the YouTube api to post to a specific channel?

I need to post videos to specific YouTube channels via the V3 api managed by a single account.
I am trying to use the onBehalfOfContentOwner & onBehalfOfContentOwnerChannel fields to upload the video but I'm somewhat confused about the account requirements in order to enable this.
My understanding is that it is only possible to do this with channels that are managed by a Partner Account. I have set up my account as a partner account and the next thing the documentation talks about is using a CMS account. To give permissions to manage channels. The documentation seems to suggest that a CMS account is generated automatically once you become a partner account, but I can see no sign of this.
The documentation then goes on to talk about having to have a Partner Content ID in order to get a Full CMS account. This appears to be something that you have to apply for.
Is it really necessary that the account and channels have to be set up in this way or is there an easier way to manage this?

How to relate a Youtube Channel and its Google account after deprecation of "googlePlusUserId"?

The "googlePlusUserId" of the YouTube channel object has been deprecated in the last review of the Youtube Data API (June 13, 2016). From the YouTube Data API revision history:
The channel resource's contentDetails.googlePlusUserId property has been deprecated. Previously, the property was only present if the channel was associated with a Google+ profile. Following the deprecation, the property will no longer be included in any channel resources.
I was using this property to relate a YouTube channel with its Google account. By this way I was able to verify in my page that a user signed in with Google is the owner of a YouTube channel. So how to do it now without this property?
Use case
My use case is a web application which invites some YouTube Channels (users) to the website. Ideally this invitation must be with a direct email to the email of the user or a direct message to the YouTube Channel through the YouTube Data API. However, both options are not viable because it is impossible to retrieve the email and actually there is not a functionality to send direct messages to a YouTube Channel through the API. So to invite a YouTube channel we have to manually go to the YouTube Channel about page and send a message to the user with the link to join our page. This link is an URL with a token identifying this invite but we need to be sure that the user coming from this link is the owner of the YouTube channel which has been invited, so the only way is logging in with his YouTube channel account which is the Google account.
I hope I have explained it well, if you have any doubt ask me.
Thank you!
I found a solution. You can make another call to people/me Google+ API endpoint to get the id of currently logged Google user.
Here you can find more information about OAuth scope you have to to grant to the token for access to user's data.

Youtube Content ID API has not been used - error 403

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

Youtube API: nolinkedyoutubeaccount error returned from api after disconnecting it from google plus identity

Rephrasing of the question:
Using the youtube api v 3.0 with oauth, when the user is sent to login, they have more than one option: e.g. the linked youtube account and the google account. The two different logins (access tokens) have different access to the api. I need the ability to just sent the user to log in to their proper youtube account (if they have one). How can my app do this? The user currently will have no idea which option they are supposed to choose, even if the app might be able to tell which they have chosen afterwards.
https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=1056190619576.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https:%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube
original phrasing of the question:
OK, this is getting really really confusing. My youtube account uses a gmail, so I think that it is safe to say that it is linked to my google account (if such a thing linkage does exist). A couple of days ago I was on youtube, and the web site roped me into giving my youtube account its own google+ account (as far as I could tell). My gmail/google account does not have google+. Anyway, shortly thereafter I undid the linking of a google+ account to the channel. Ominously, at this point youtube indicated that this was only temporary.
And the net effect of this is: I can't use the youtube api with the youtube account. It says nolinkedyoutubeaccount .
So, the youtube api seems unusuable to me. This confusion is enough to make a person's head spin. But can anyone suggest a solution to get my account working with the api again?
Edit: I have managed to reproduce the error (more or less) with a newly opened youtube account. More here: https://code.google.com/p/gdata-issues/issues/detail?id=4860
These blog posts should help explain what's going on
http://apiblog.youtube.com/2013/06/google-page-identities-and-youtube-api.html
http://youtubecreator.blogspot.com/2013/04/using-google-page-identity-on-youtube.html
Based on what you describe, I think things are working as intended, but you do need to be careful to ensure that you select the correct channel when going through the OAuth 2 flow.

Resources