Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YouTube channel subscribe for Android

I am using the YouTube API within my app. Users can log in with their Google+ account. I would like the user to be able to subscribe to certain YouTube channels.

There seems to be something for web here: https://developers.google.com/youtube/subscribe/

But I can't find something suited to Android. Am I missing something from the documentation or is there a workaround?

like image 396
Muz Avatar asked Jan 21 '16 02:01

Muz


1 Answers

You don't need a specific Android library to subscribe an authenticated user to a specific channel. Just send an authenticated POST request to the subscriptions/insert endpoint with the channelId of the channel you want to subscribe to with the Part param snippet:

HTTP POST https://www.googleapis.com/youtube/v3/subscriptions?part=snippet&key={YOUR_API_KEY}

Request body:

{
    "snippet": {
        "resourceId": {
            "channelId": "XXXXX" // channel ID you want to subscribe to
        }
    }
}
like image 64
JAL Avatar answered Oct 05 '22 08:10

JAL