How do I find the immutable id of my Google Apps account?
Asked Answered
U

5

15

Many of the Directory API calls require a customer parameter referred to as the "Immutable id of the Google Apps account. (string)".

e.g. GET https://www.googleapis.com/admin/directory/v1/customer/customer/domains

I have no idea how to find/generate this for my Google Apps account. I am an admin.

Can someone point me in the right direction please?

Unbelief answered 3/11, 2015 at 7:57 Comment(1)
You can call the method Users.get with your own account, at the end of the response you can find the customerId.Stocking
R
16

I was able to find the customerId as follows

  1. Go to admin.google.com
  2. Security -> Set up single sign-on (SSO)

You will see URLs like this:

https://accounts.google.com/o/saml2/idp?idpid=Cxxxxxxxx

That Cxxxxxxxx is your customerId

Rubio answered 8/3, 2016 at 20:41 Comment(2)
Couldn't find it this way; perhaps they changed the link structure?Pronto
I am able to still see the same URLs and cust id, Just tried this now.Rubio
O
6

Had the same question, so I had to contact their chat support.

The official answer was:
There are no any web interface to look up this information - as I would expect for example in "organisation admin panel". The only way to get this information is from the code.

You have to write extra code to request information about any existing user:
(Link to API Docs - GET: https://www.googleapis.com/admin/directory/v1/users)
And in the response, you can find field customerId which is the same for each user in the company across all domains.

That is the only way to find your organisation customerId...

Not user-friendly, so I will submit "Feature Request" right now to Google.

Overdone answered 17/12, 2015 at 12:6 Comment(1)
This method required the customer id which left me puzzled. I later found that 'my_customer' can be used in place of the customer id and indeed the actual customer id is included in the response.Pronto
P
3

The easiest way I found was to use the APIs Explorer at the bottom of the documentation for the Customers: get method on the Directory API (Admin SDK). Enter 'my_customer' for the customerKey on the form and hit the 'Authorize and Execute' button.

The response will include the CustomerId (e.g. Cxxxxxxxx) as the "id". The entire response will look something like this:

{
  "kind": "admin#directory#customer",
  "id": string,
  "etag": etag,
  "customerDomain": string,
  "alternateEmail": string,
  "postalAddress": {
    "organizationName": string,
    "countryCode": string,
  },
  "language": string,
  "customerCreationTime": datetime
}
Pronto answered 18/9, 2016 at 15:20 Comment(0)
O
3

If you are part of an organization, you can find it here as Organization ID: https://play.google.com/work/adminsettings?pli=1

It works for G Suite accounts and Gmail accounts that are associated with an organization, but not for individual Gmail accounts.

Ophiuchus answered 24/10, 2018 at 14:38 Comment(0)
A
0

I found something simpler: gcloud organizations list. It will give you DISPLAY_NAME, ID and DIRECTORY_CUSTOMER_ID (this is what your are looking for) for all you organizations.

Archiplasm answered 6/2, 2022 at 21:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.