Am trying to figure out the API. Were in the web interface can, as an administrator, find the "content owner id" of my managed accounts?
All I see is this:
"To retrieve a content owner report, call the API's reports.query method and set the ids parameter value in the API request to contentOwner==OWNER_NAME, where OWNER_NAME specifies the content owner's ID. Ask your partner manager if you are unsure of the value."
Surely I don't have to call Google to get this value?
You may refer with this SO answer on how to get the content owner id.
Assuming you have an OAuth 2 token with access to the
https://www.googleapis.com/auth/youtubepartnerscope, you can make an API call toyoutubePartner.contentOwners.list(fetchMine=true)to get back a list of YouTube content owners associated with the current OAuth 2 token. (There will normally only be one item returned.) You can then get the content owner id value from theidproperty of each item in theitemslist that's returned. This is the value that you can use when making content owner YouTube Analytics API reports, or using theonBehalfOfContentOwnerdelegation parameter in the YouTube Data API v3.
You need to query youtubePartner.contentOwners.list(fetchMine=true) to obtain the content owner info. Also make sure that you have this API available in your console or ask your partner manager if you are eligible for this API.
If you want to know the content owner id of only one account, you can check the URI.
There are various ways to retrieve the id from the URI:
https://studio.youtube.com/owner/.https://www.youtube.com/analytics?o= and before &ar.If you want to retrieve a list of all content owner IDs linked to your admin account, it's much easier to do it via the API. If you don't want to write a script for that, you can just use the Google API explorer (on the right) here: https://developers.google.com/youtube/partner/docs/v1/contentOwners/list
Just set fetchMine to true and sign in to your account. The output below should give you a list of the content owner names, IDs and other info.
To retrieve the content owner IDs via the API, samples can also be found here: https://developers.google.com/youtube/partner/code_samples/ (check the docs "Retrieve a content owner's managed channels (channels.list)" in your language).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With