8

My company uses a Gmail-based email server. For integration with a partner's system I have been asked for my Gmail "user ID", here is what they wrote:

there are usually two emails associated, one should be n[email protected], the other one should be [email protected]

Searching the web reveals this question on StackOverflow:

How to get Google User ID something which looks like "1242343543557656", using the GMail address in Android?

QUESTION: As a simple web user, how can I get my ID?
Or is there no such thing?

I could not find it at https://myaccount.google.com

0

6 Answers 6

0

You can use the Google OAuth Playground to extract your ID:

  1. GO to https://developers.google.com/oauthplayground

  2. Authorize all the scopes inside "Google OAuth2 API v2"

  3. Exchange Auth code for tokens

  4. Finally send a request to: https://www.googleapis.com/oauth2/v2/userinfo

  5. You will get the user information including the id:

    { "family_name": "Perez", "name": "David G", "picture": "https://lh3.googleusercontent.com/...", "locale": "es", "email": "em[email protected]", "given_name": "David", "id": "223910233017997158888", "hd": "domain.es", "verified_email": true }

2
  • Welcome to Web Applications. I don't know why this answer was downvoted; it doesn't look so bad at first sight. It might be helpful if you are more context, especially considering this is an old question and Google has changed how the integration is done. Do you know about a context where it's still relevant to know the Google user id?
    – Rubén
    Jul 27 at 15:01
  • Tested now, it works! :-)
    – nic
    Jul 28 at 2:57
1

PREVIOUSLY:

  • Sign in to your AdWords account
  • Look in the top right corner of any page.
  • Find Customer ID above your email address.

NOWDAYS:

  • Sign in to your AdWords account
  • Click the help icon in the top right corner.
  • Find Customer ID at the bottom of the menu.

API ID REQUEST: https://developers.google.com/gmail/api/

1

You can use your email account in API.

If you have [email protected].
You can use that in API instead of userId.

enter image description here

0
0

Now deprecated services like Picasa Web Albums used to show the user id on links

From https://support.google.com/picasa/answer/6383491?hl=en

Links that will continue to work

  • Links to photos and albums whose URLs use your user ID number (and not your username).
  • Links to Public Galleries whose URLs use your user ID number (and not your username).

If you used Picasa Web Albums and shared a link to one of your albums through email or something like that, that could help you to find your user id as a " simple web user".

Reference

0

If all you have at your disposal is a browser, you can go to https://myaccount.google.com/ and View Page Source

The Numeric Id will be written multiple times, search one of these, for example:

"qDCSke":

or

"S06Grb":

or

"qDCSke":

If those are followed by a long number (about this long: 123456789012345678901) that, when searched, brings up several results (8 in my case), that's probably it.

Caveat: Those strings may change with time. If that happens, you can look in the page source for the first occurrence of your mail address, and try to find close by a long number (about this long: 123456789012345678901) and then check if the number you find is repeated throughout the page source.

-2

OK, here it goes, it is complicated to get, but it is there.

  1. get the Google AUTH object, for instance I'll include partial code when dealing with firebase:

    const provider = new GoogleAuthProvider()
            // To assing the language explicitly:
            const auth = getAuth(app)
            // auth.languageCode = 'it';
            // To apply the default browser preference instead of explicitly setting it.
            auth.useDeviceLanguage()
            try{
                const result = await signInWithPopup(auth, provider)
                console.log(new Date(), auth: ', auth, ' provider: ', provider)
                // This gives you a Google Access Token. You can use it to access the Google API.
                const credential = GoogleAuthProvider.credentialFromResult(result)
                const currentGoogleToken = credential.idToken
                // The signed-in user info.
                const user = result.user
                console.log(new Date(), 'credential: ', credential, ' token: ', currentGoogleToken, 'user: ', user)
                setError('')
                console.log(new Date(), 'the google user id of whoever requested access using their google account: ', user.providerData[0].uid)
                cosnole.log(new Date(), 'same uid but starting from the auth. uid: ', auth.currentUser.providerData[0].uid)
    
    } catch(err){
    //...deal with the error
    }
    

When you do this you realize the the user is a property inside the AUTH object, from there you can extract the user implementation as an object. Inside that object you will find a property called 'providerData', which is an array whose first member contains the raw google information of the user (yourself?). Inside that property you will find the uid property that will contain you google user id (or the uid of the user that provided you with the data in the example above, namely he who requested authorization to log into your app with his google account).
So user.providerData[0].uid

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.