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 7829489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:47:45+00:00 2026-06-02T10:47:45+00:00

I want to know if it is possible to get the userId value using

  • 0

I want to know if it is possible to get the “userId” value using the Google+ api, in order to display a link to some specific user profile. For better explanation, I have a PHP application and there is a panel where I can view the existing users in my database. So, when detailing a specific user, I want to show a Google+ badge which will link to that user’s Google+ profile. I don’t have the “userId”, but still have access to his email address. Any suggestions?

  • 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-06-02T10:47:46+00:00Added an answer on June 2, 2026 at 10:47 am

    There is no endpoint that you can hit to convert an email address into a Google+ userId.

    However, you can use the REST API to determine the Google+ userId of the currently logged in user. This will require the user to grant you access to their identity on Google+ via OAuth. To do this use the people get endpoint with me as the userId. You can try this out on the API Explorer to observe what the user experience with the OAuth dialog will be like.

    Here’s some code lifted from the PHP starter project that illustrates everything you need to fetch the userId of the current user:

    if (ini_get('register_globals') === "1") {
     die("register_globals must be turned off before using the starter application");
    }
    
    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("Google+ PHP Starter Application");
    // Visit https://code.google.com/apis/console to generate your
    // oauth2_client_id, oauth2_client_secret, and to register your oauth2_redirect_uri.
    $client->setClientId('insert_your_oauth2_client_id');
    $client->setClientSecret('insert_your_oauth2_client_secret');
    $client->setRedirectUri('insert_your_oauth2_redirect_uri');
    $client->setDeveloperKey('insert_your_developer_key');
    $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();
      $redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
      header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
    }
    
    if (isset($_SESSION['access_token'])) {
      $client->setAccessToken($_SESSION['access_token']);
    }
    
    if ($client->getAccessToken()) {
      $me = $plus->people->get('me');
      // Do stuff with the id
      echo $me['id'];
    
      // The access token may have been updated lazily.
      $_SESSION['access_token'] = $client->getAccessToken();
    } else {
      $authUrl = $client->createAuthUrl();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want know if is possible, to get a specific element value of a
I want to know if its possible to get the return value from batch
I want to know if it's possible to register a type library without using
i have an asp fileupload control, i want to know,,is it possible to get
I want to know if it's possible to get a remote flv file and
I want to know if it is possible to get an ant script to
I want to know is it possible to get xpath of the element such
I want to know that it is possible to get event name from datepicker
I want to know if it is possible to get the decoded frames from
I want to know if its possible to get the functionality of group by

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.