on-internet
← Community

Google API 401 Invalid Credentials

Stack Overflow ·

I'm trying to use Oauth2 to access Analytics data. I successfully get authorization code from and change it for authorization token. But when I try to get any data from Analytics API I get 401 Invalid Credentials error. The code I'm using is from PHP client library: <?php ini_set('display_errors', 1); error_reporting(E_ALL); require_once 'lib/API/Google_Client.php'; require_once 'lib/API/contrib/Google_AnalyticsService.php'; session_start(); $client = new Google_Client(); $client->setApplicationName("APP name"); $client->setClientId('xxx.apps.googleusercontent.com'); $client->setClientSecret('

Comments

Sign in or sign up to comment and upvote.

No comments yet.