1
votes

I want a way of selecting a YouTube channel through the Google authentication form. My problem is: when I call the method

$youtube->channels->listChannels(.., array('mine'=>'true'))

it returns only one channel, instead I have two channels and I would like the method to return me both or at least to let me choose between my channels. The weird thing is that the API explorers behave differently:

// Good behavior but I don't know how to implement it

If I make a request with this API Explorer: https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list?part=snippet%252CcontentDetails%252Cstatistics&mine=true&_h=1& It gives me the chance to select my YouTube channels in the Google login window.

// Bad behavior, I have implemented it

Instead, if I make the same request here: https://developers.google.com/youtube/v3/docs/channels/list, selecting 'list (channels managed by a content owner)' in the Usage section, The Google authentication window makes me choose only the Google Account and gives me always ONLY ONE channel.

1

1 Answers

0
votes

Refer to the comment in this SO post.

What do you mean by connected? is it subscribed to a channel or as you owned? By setting the parameter to true, you instruct the API to only return channels owned by the authenticated user.

You can refer here for Implementing OAuth 2.0 Authorization.

The YouTube Data API supports the OAuth 2.0 protocol for authorizing access to private user data.