-2

i have to use google api in my project using php the project : using google search engine and gathering urls and their source pages

i downloaded google api php client and i followed what ever is written here https://code.google.com/p/google-api-php-client/

after running i ge this error:

Fatal error: Uncaught exception 'Google_ServiceException' with message 'Error calling GET https://www.googleapis.com/plus/v1/people/me/activities/public?key=[REDACTED]: (403) Access Not Configured' in C:\xampp\htdocs\google-api-php-client\src\io\Google_REST.php:66 Stack trace: #0 C:\xampp\htdocs\google-api-php-client\src\io\Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest)) #1 C:\xampp\htdocs\google-api-php-client\src\service\Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest)) #2 C:\xampp\htdocs\google-api-php-client\src\contrib\Google_PlusService.php(58): Google_ServiceResource->__call('list', Array) #3 C:\xampp\htdocs\googleapitest.php(31): Google_ActivitiesServiceResource->listActivities('me', 'public') #4 {main} thrown in C:\xampp\htdocs\google-api-php-client\src\io\Google_REST.php on line 66

i am completely confused and don't know what to do

Morten Kristensen
  • 7,412
  • 4
  • 32
  • 52
Armita
  • 21
  • 1
  • 6
  • Check this out http://stackoverflow.com/questions/14348689/google-api-returning-access-not-configured – exussum Sep 15 '13 at 00:48
  • 2
    Aren't those Google API keys somewhat sensitive? From developers.google.com: [Warning: Keep your API key private. If someone obtains your key, they could use it to consume your quota or incur charges against your Google APIs Console project.](https://developers.google.com/api-client-library/python/guide/aaa_apikeys) – Richard JP Le Guen Sep 15 '13 at 00:52
  • I have flagged this question as needing moderator attention: editing the question doesn't remove it from [its publicly-visible revision history](http://stackoverflow.com/posts/18807809/revisions) – Richard JP Le Guen Sep 15 '13 at 19:38

2 Answers2

0

That error often means you're not matching your access requirements in the API console - i.e. if you have IP or referrer restrictions configured.

Collin Grady
  • 2,226
  • 1
  • 14
  • 14
0

Just remove your developer key and add the scope

'www.googleapis.com/auth/userinfo.email',
'www.googleapis.com/auth/userinfo.profile', 
'www.googleapis.com/auth/plus.login',
'www.googleapis.com/auth/plus.me'));
Pang
  • 9,564
  • 146
  • 81
  • 122