Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 609
Hevski Avatar asked Nov 19 '13 13:11

Hevski


People also ask

Can you still use YouTube API v2?

You can continue using the v2 API for comments and uploading video captions for now, and we'll be adding this functionality into the v3 API soon.

Is YouTube Data API v3 free?

Yes, using the YouTube API does not incur any monetary cost for the entity calling the API. If you go over your quota an 403 Error will be returned by the API.

What data can you get from YouTube API?

The API provides the ability to retrieve feeds related to videos, users, and playlists. It also provides the ability to manipulate these feeds, such as creating new playlists, adding videos as favorites, and sending messsages.


2 Answers

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...

like image 101
Hevski Avatar answered Nov 26 '22 08:11

Hevski


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.

like image 26
Ibrahim Ulukaya Avatar answered Nov 26 '22 08:11

Ibrahim Ulukaya