Posts

Showing posts with the label youtube-data-api

How to get API key for user using Google's OAuth API?

Image
Clash Royale CLAN TAG #URR8PPP How to get API key for user using Google's OAuth API? Maybe I'm not understanding how the Youtube Data API is supposed to work. But if I have a PHP application that will generate the oauth request and receive the callback (which I have), the data it sends back is not a user's API key. So I don't know if I am doing this wrong, or what, but their documentation is giving me a headache and I have searched and searched and I don't even know if my process is right here: Web Server / OAuth Request (php) require_once 'vendor/autoload.php'; $client = new Google_Client(); $client->setAuthConfig('oauth.json'); $client->setAccessType("offline"); // offline access $client->setIncludeGrantedScopes(true); // incremental auth $client->addScope(Google_Service_YouTube::YOUTUBE_READONLY); $client->setRedirectUri('http://' . $_SERVER['HTTP_HOST'] . '/oauth2callback.php'); $auth_url ...