问题
The "googlePlusUserId" of the YouTube channel object has been deprecated in the last review of the Youtube Data API (June 13, 2016). From the YouTube Data API revision history:
The channel resource's contentDetails.googlePlusUserId property has been deprecated. Previously, the property was only present if the channel was associated with a Google+ profile. Following the deprecation, the property will no longer be included in any channel resources.
I was using this property to relate a YouTube channel with its Google account. By this way I was able to verify in my page that a user signed in with Google is the owner of a YouTube channel. So how to do it now without this property?
Use case
My use case is a web application which invites some YouTube Channels (users) to the website. Ideally this invitation must be with a direct email to the email of the user or a direct message to the YouTube Channel through the YouTube Data API. However, both options are not viable because it is impossible to retrieve the email and actually there is not a functionality to send direct messages to a YouTube Channel through the API. So to invite a YouTube channel we have to manually go to the YouTube Channel about page and send a message to the user with the link to join our page. This link is an URL with a token identifying this invite but we need to be sure that the user coming from this link is the owner of the YouTube channel which has been invited, so the only way is logging in with his YouTube channel account which is the Google account.
I hope I have explained it well, if you have any doubt ask me.
Thank you!
回答1:
I found a solution. You can make another call to people/me Google+ API endpoint to get the id of currently logged Google user.
Here you can find more information about OAuth scope you have to to grant to the token for access to user's data.
来源:https://stackoverflow.com/questions/38074824/how-to-relate-a-youtube-channel-and-its-google-account-after-deprecation-of-goo