Switching between channel accounts - youtube-api

I'd like to have a way to allow users to switch between channels that they are managing.
The app doesn't seem to recognize the new identity after I've gone to YouTube.com and switched to another channel backed by a G+ Page I'm managing. Let's call this Channel B. When I return to my app, it seems to always choose the main YouTube channel (linked to my #gmail.com account) as the default. Let's call this Channel A.
After signing out of YouTube and re-authenticating on my app as Channel B, I am able to operate as Channel B, but once I refresh the page, my identity gets switched back to Channel A.
Is there a good way to implement channel switching to ensure that my app always chooses the current YouTube channel account? I am using the gapi javascript libraries and would like to avoid writing server-side code.
Thanks!

You can not manage channel switching or login activities. You only get one channel out of OAuth2.
Here is a little more detail: http://apiblog.youtube.com/2013/06/google-page-identities-and-youtube-api.html

Related

Retrieving YouTube API v3 data for all my channels

I have five YouTube channels that are all under one user account (one e-mail address). I can switch between them at will within the YouTube mobile app, YT Studio and so on by using the app's Switch Account function.
I also have developed some processes that will retrieve statistics about my primary channel's videos and store them into a database.
I would like to also retrieve the same information about all my other channels, but I don't seem to be able to do this. Those processes can see only PUBLIC information about the other channels. So unlisted/private videos are skipped, for example. The simple solution would be to create credentials for the other channels of interest and apply those new credentials to the processes, but I don't see a way to create credentials for any account other than the primary on the Google Developer Console
Am I missing something about Developer Console that would allow me to create other sets of credentials for the other channels? Or maybe there's a "switch account" equivalent I'm not aware of? Or what other solution is available for multiple channels?
According to this link, this is the correct forum for my question, but Google seems to be unresponsive more often than not.

YouTube API - List all channels that I manage

I have a YouTube channel for my personal account, and one for my business account. I have associated a Google+ page to both channels. In the business account, I have clicked "Managers" (in the drop down in the top right), and added my personal gmail account as a Manager. This has all worked fine.
Now, though, I am trying to use the YouTube API to list all of the channels that my personal account has rights to manage. I'm trying to use the Google Developer's page here https://developers.google.com/youtube/v3/docs/channels/list#try-it but it is only returning the one channel that is directly associated with my personal account. I'd expect it to return both the personal channel and the business channel.
Is there a way, an api call, or a setting that will allow me to make a single api call for an oauth user and see all of the YouTube channels / Google+ Pages that the user has permissions to manage?
I you are using the WebView for authentication, the user has to choose the YouTube account to be used. The channel will then be returned. If you are using Android OAuth, the only way to specify a channel is for the user to select the "default channel" in the advanced YouTube account settings.
http://youtube-eng.blogspot.de/2013/06/google-page-identities-and-youtube-api_24.html
I don't think that you can manage different accounts (even if they have linked to eachother) with the same API key. Sub-channels can be managed with the same API key with main channel. Which version of API are you using?

YouTube API v3 get all channels associated with a logged in user

Is it possible to get all the channels associated with a logged in user account, using youtube's version 3 API (https://developers.google.com/apis-explorer/#p/youtube/v3/).
The nearest call that I can see for YouTube.channels.list
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list
I attempt to use this by 'Authorizing the requests using OAuth 2.0' I select part=snippet and mine=true
https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list?part=snippet&mine=true&_h=1&
but this only brings back the single channel not any of the other channels associated with the account, but the account I'm using has several channels. I need to get all channels for logged in user so I can give them the choice of what channel they are using, especially now google have messed YouTube around with the Google plus integration.
Does anybody know if this is possible?
Found the answer in YouTube's API Blog here:
http://apiblog.youtube.com/2013/06/google-page-identities-and-youtube-api.html
According to this as I'm using Android with OAuth2 there is no native Android account switcher, and
the then the API will choose the “wrong” channel in some cases, or
even no channel (e.g., if the personal account doesn’t have a
channel).
So I've got two options When this happens, the user has two options to specify the correct channel:
Use the Advanced Account Settings tool to select which channel should
be used. This is recommended when a user has one channel they want to
use for all applications.
Set up login credentials for each of their Google+ pages, and specify those > credentials, not their normal Google Account
credentials, for each application that needs access.
Both these options require the user to do something outside the boundary of the Android Application, so both solutions are not usable. Unfortunatly this piece of functionality will have to wait until Android has some better way of switching the channel for the user...
OAuth2 allows login in with only one channel, so that's not possible.
OAuth2 already gives user a choice to pick the channel they want to authorize and give access, so you don't have to implement it anyways.

Can I access to many Youtube channels reports with a only one account?

I manage several Youtube channels, each with their Gmail account and now also associated with a Google+ account.
My question is: I can access, via Youtube Analytics API, to all my Youtube channels reports with a single Google account without having to choose between them? That is, a general account with permissions to access reports on all channels.
Thanks in advance.
Yes, you actually can have these different channels linked under a single Google account.
1) Set up a Google Plus Page for your YouTube account via https://www.youtube.com/account (requires g+ account) Note: This may overwrite avatar and channel title, and may change your YouTube display name to whatever you set your Page Title to be.
2) Your personal g+ account will be the owner of this Google plus page.
3) Repeat for other accounts, setting up their own google plus pages.
4) You can add your main personal g+ account (if you have one for each unique gmail) as a "manager" of these other pages, giving a single login access to the pages (and therefore all the associated YouTube accounts) via the drop down "switch acocunts" on YouTube (top right drop down)
5) After a page is old enough (2 weeks?) you can change owners so your main g+ page owns the page. Not necessary but helps consolidate + lets you abandon other personal g+ accounts.
Let me know if you're able to follow that. There are benefits to doing this with only a single channel. You won't be able to see "combined" analytics but you can switch accounts much, much easier.
This link provides the youtube channel report in range. But when used with google php library it get hooked in a "User login required Error!"
https://developers.google.com/apis-explorer/#p/youtubeAnalytics/v1/youtubeAnalytics.reports.query?ids=channel%253D%253DMINE&start-date=2014-05-01&end-date=2014-06-30&metrics=views&dimensions=day&_h=3&
Is there any way i can access the channel analytics report in youtube V3 same as like in v3
http://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list?part=statistics&id=UCMGgBRBiijmpgL3xNuiDVOQ&_h=10&

sharing a youtube channel with google+

I have a YouTube channel that is not connected with Google+, because it was created before YouTube put in the policy that every channel be connected to Google+. So I'd like to know the following:
How do I connect it to Google+?
If I can't, and I have to make a new channel, how do I add a video to that channel, and not the first channel
Once my channel (and therefore all videos in it) is connected to Google+, how do I share it with just one Google circle and not the whole world?
You can connect your YouTube channel to either a Google+ Personal Profile or to a Google+ Page. In general, the latter is the preferred solution.
To connect to a Profile, see https://support.google.com/youtube/answer/2657961?hl=en
To connect to a Page, see https://support.google.com/youtube/answer/2897336?hl=en
Once you have done this, you can make a video private and share it to one of your circles through the Video Info Edit page.

Resources