470,596 Members | 1,314 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,596 developers. It's quick & easy.

get youtube channel subscribers via youtube API

Hello
I'm trying to use Google Api to get a list of youtube channels the users subscribed to using this file https://github.com/google/google-api...er-example.php and setting $client_id,$client_secret and $redirect_ur. The redirect url is another webpage that stores the code in a variable and it's the same url in the google developer app settings. after running the page I get redirected to the url that looks like this

Expand|Select|Wrap|Line Numbers
  1. http://mywebsite.com/google/test.php?code=code here
  2. $code = $_REQUEST['code'];
Now I want to use the access token to get a list of youtube channel ids the user had subscribed to using this code

Expand|Select|Wrap|Line Numbers
  1. $data =file_get_contents('https://www.googleapis.com/youtube/v3/subscriptions?part=snippet
  2. &maxResults=50&access_token='.$code.'&mine=true&key=My API Key Here');
  3. var_export($data) 
But i get "false". How to solve this?
Jan 29 '15 #1
0 2953

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by AngelDude | last post: by
reply views Thread by Serge Rielau | last post: by
reply views Thread by ahmad | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.