Following this guide, I am trying to get a Youtube subscription. I can get the user authentication token, but I donβt know HOW to send it with my cURL request. The docs just say this:
To request a feed of inbound subscribers, send a GET request to the following URL. Note. For this request, you must provide an authorization token that allows YouTube to verify that the user has allowed access to the resource.
https://gdata.youtube.com/feeds/api/users/default/subscriptions?v=2
When I send a request without a token, I get a 401 user authentication error. I can not find information on how to send a token. Here is my current code:
$ch_subs = curl_init(); curl_setopt($ch_subs, CURLOPT_URL, 'https://gdata.youtube.com/feeds/api/users/default/subscriptions?v=2'); curl_setopt($ch_subs, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch_subs, CURLOPT_SSL_VERIFYPEER, false); $subs_return = curl_exec($ch_subs); curl_close($ch_subs);
Thanks in advance for your help.
source share