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 http
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
}
I was able to find the customerId as follows
You will see URLs like this:
https://accounts.google.com/o/saml2/idp?idpid=Cxxxxxxxx
That Cxxxxxxxx is your customerId
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.
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.