Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google API login

I try to fetch data from google analytics using the google api class in php. I checked serval google groups and found out that the error comes most of the time when Curl is off and SSL is off too, but I checked in the phpinfo() and booth are running. Anyone an idea what it could be? On my local server it's running, but on the webserver it's not running.

<br />
<b>Fatal error</b>:  Uncaught exception 'Exception' with message 'GAPI: Failed to authenticate user. Error: &quot;Error=BadAuthentication
Url=https://www.google.com/accounts/ServiceLogin?service=analytics#Email=mail
Info=WebLoginRequired
&quot;' in /home/express/public_html/loggedIn/gapi.class.php:418
Stack trace:
#0 /home/express/public_html/loggedIn/gapi.class.php(62): gapi-&gt;authenticateUser('mail', 'pw')
#1 /home/express/public_html/loggedIn/request.php(10): gapi-&gt;__construct('mail', 'pw')
#2 {main}
  thrown in <b
>/home/express/public_html/loggedIn/gapi.class.php</b> on line <b>418</b><br />

enter image description here

like image 583
Johnny000 Avatar asked Apr 01 '13 11:04

Johnny000


People also ask

Is it sign-in with Google API is free?

Some Google APIs charge for usage, and you need to enable billing before you can start using these APIs. Enabling billing for the APIs that your projects use also has other advantages: Some APIs allow free usage up to a courtesy usage limit, and in some cases this free limit is increased when you enable billing.


1 Answers

So after browsing more groups, a friend found out that you need to approve your account before you start fetching data for the first time at this url

like image 63
Johnny000 Avatar answered Sep 18 '22 13:09

Johnny000