Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7189141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:14:18+00:00 2026-05-28T19:14:18+00:00

I have a small card game for Google+ which needs the visitor’s name, avatar,

  • 0

I have a small card game for Google+ which needs the visitor’s name, avatar, gender and city.

It works for myself, but in the error_log I see a lot of PHP-exceptions:

[28-Jan-2012 19:06:33] PHP Fatal error:  Uncaught exception 'apiServiceException' with message 'Error calling GET https://www.googleapis.com/plus/v1/people/me?alt=json&key=AIzaSyAgQl0UeNM553PfLnPmP0jTtcJ8ZIQ3q0g: (404) Not Found' in /var/www/html/preferans.de/google/google-api-php-client/src/io/apiREST.php:86
Stack trace:
#0 /var/www/html/preferans.de/google/google-api-php-client/src/io/apiREST.php(56): apiREST::decodeHttpResponse(Object(apiHttpRequest))
#1 /var/www/html/preferans.de/google/google-api-php-client/src/service/apiServiceResource.php(151): apiREST::execute(Object(apiServiceRequest))
#2 /var/www/html/preferans.de/google/google-api-php-client/src/contrib/apiPlusService.php(207): apiServiceResource->__call('get', Array)
#3 /var/www/html/preferans.de/google/index.php(33): PeopleServiceResource->get('me')
#4 {main}
  thrown in /var/www/html/preferans.de/google/google-api-php-client/src/io/apiREST.php on line 86

Here is my script:

<?php

require_once('google-api-php-client/src/apiClient.php');
require_once('google-api-php-client/src/contrib/apiPlusService.php');

session_start();

$client = new apiClient();
$client->setApplicationName('Video-Preferans');
$client->setClientId('XXX.apps.googleusercontent.com');
$client->setClientSecret('XXX');
$client->setRedirectUri('http://preferans.de/google');
$client->setDeveloperKey('XXX');
$client->setScopes(array('https://www.googleapis.com/auth/plus.me'));
$plus = new apiPlusService($client);

if (isset($_REQUEST['logout']))
        unset($_SESSION['access_token']);

if (isset($_GET['code'])) {
        $client->authenticate();
        $_SESSION['access_token'] = $client->getAccessToken();
        header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
}

if (isset($_SESSION['access_token']))
        $client->setAccessToken($_SESSION['access_token']);

if ($client->getAccessToken()) {
        $me = $plus->people->get('me'); # XXX line 33 XXX
        # the access token may have been updated lazily
        $_SESSION['access_token'] = $client->getAccessToken();
} else {
        printf('
<!doctype html>
<html>
<head>
<body>
<p><a href="%s">Play Preferans</a></p>
</body>
</html>
', $client->createAuthUrl());
        exit();
}

$viewer_id = $me['id'];
list($first_name, $last_name) = explode(' ', $me['displayName']);
$city      = $me['placesLived'][0]['value'];
$female    = ($me['gender'] == 'male' ? 0 : 1);
$avatar    = $me['image']['url'];

....skipped some html code....

Does anybody please know, why the apiServiceException is being thrown?

Or how and where at least catch it, so that I can debug it better?

I’m using the latest Google+ SDK 0.4.8.3 and also I’m requesting very basic user information and as I’ve written – it works for me and also for my wife’s account.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:14:18+00:00Added an answer on May 28, 2026 at 7:14 pm

    You can wrap $me = $plus->people->get(‘me’) within a try/catch block.

    The plus/v1/people/me API returns a 404 Not Found when the user hasn’t registered for Google+, and you can catch this case with the following:

    try {
       $me = $plus->people->get('me')
    } catch (apiServiceException $e) {
      // Handle exception. You can also catch Exception here.
      // You can also get the error code from $e->getCode();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small card game at Facebook (and few Russian social networks), which
I've been developing a small card game which is called Tarneeb. The game itself
I'm developping a card game. I have an ASP.NET page with some 52 small
I have small page which has label, DropDownList and a submit button. <div> <asp:label
I have small database of business and their addresses. Using the Google Geocode API
I have a profile card of user that have registration in my forum. Person.update_all({:name
have small problem, and would very much appreciate help :) I should convert byte
I have small problem with my .net 2.0 winforms application. I want to embed
I have small utility that does some processing on a file and changes the
I have small test app: Socket socket = new Socket(jeck.ru, 80); PrintWriter pw =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.