Quantcast
Viewing all articles
Browse latest Browse all 3

PHP - Getting Channel ID after OAuth - YouTube API

Firstly, this question may sound like a duplicate but from the answers I've already seen I think the answers don't correctly fit this purpose because I do not have permission.

I'm trying to find a YouTube channel ID after they authorize their Google account.

The scopes I am using are:

https://www.googleapis.com/auth/yt-analytics.readonlyhttps://www.googleapis.com/auth/userinfo.profile

A lot of the answers refer to accessing the V3 channels api to get the channel id.

$channelData = file_get_contents("https://www.googleapis.com/youtube/v3/channels?part=id&mine=true&access_token=".$token['access']);$channelData = json_decode($channelData, true);

The issue is with the scopes I'm using you cannot access this. The other questions on SO all revolve around this endpoint.

Youtube API Retrieving Channel ID after authentication

How to get Channel ID (YouTube API v2)?

How to Get Channel id or url after Google Oauth PHP

Please note I want to keep scopes to an absolute minimum. Why wouldn't this simply be possible with just the analytics API? Will I have to use another YouTube scope to find the channel id of the person who just authorised?

The question I'm asking is

Is there any way I can get the channel id of the user who just authorised with my current scopes? If not what is the minimum-amount-of-permission-scopes I can use to get their channel id?


Viewing all articles
Browse latest Browse all 3

Trending Articles